[PATCH] Handle ld.so.conf the same in ld as in ldconfig

Alan Modra amodra@bigpond.net.au
Tue Oct 5 13:42:00 GMT 2004


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



More information about the Binutils mailing list