This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Handle ld.so.conf the same in ld as in ldconfig
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 5 Oct 2004 23:12:28 +0930
- Subject: Re: [PATCH] Handle ld.so.conf the same in ld as in ldconfig
- References: <20041004163050.GA30497@sunsite.ms.mff.cuni.cz>
On Mon, Oct 04, 2004 at 06:30:50PM +0200, Jakub Jelinek wrote:
> * emultempl/elf32.em (gld${EMULATION_NAME}_ld_so_conf): New structure.
> (gld${EMULATION_NAME}_parse_ld_so_conf,
> gld${EMULATION_NAME}_parse_ld_so_conf_include): New functions.
> (gld${EMULATION_NAME}_check_ld_so_conf): Use them.
OK.
> + newp = xmalloc (p - filename + 1 + strlen (pattern) + 1);
> + memcpy (newp, filename, p - filename + 1);
> + strcpy (newp + (p - filename + 1), pattern);
Here you might like to save the result of the strlen, and then use
memcpy rather than strcpy.
> + /* Normally this would use getline(3), but we need to be portable. */
This code is only used on native linux systems, so why not use getline?
--
Alan Modra
IBM OzLabs - Linux Technology Centre