+2006-04-05 Alan Modra <amodra@bigpond.net.au>
+
+ * Makefile.am (GENSCRIPTS): Pass prefix.
+ * Makefile.in: Regenerate.
+ * genscripts.sh: Adjust for extra parameter.
+ * emultempl/elf32.em (parse_ld_so_conf): Return true iff file
+ exists.
+ (check_ld_so_conf): Use ${prefix}/etc/ld.so.conf if it exists.
+ * NEWS: Update.
+
2006-04-05 Richard Sandiford <richard@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
# These all start with e so 'make clean' can find them.
-GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
+GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
@TDIRS@
POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
# These all start with e so 'make clean' can find them.
-GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
+GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
# We need this for automake to use YLWRAP.
* Support for the Infineon XC16X has been added by KPIT Cummins Infosystems.
-* Modify the Linux linker to seach /etc/ld.so.conf first before
- checking default search directories for DT_NEEDED entries.
+* Modify the Linux linker search order to better match ld.so search order.
+ Look for DT_NEEDED libraries in paths specified by ld.so.conf before
+ searching the default directories, rather than vice versa.
+ Use $prefix/etc/ld.so.conf if it exists, otherwise /etc/ld.so.conf.
* PE-COFF: Forward exports from DLL's can now be specified in .def files
passed directly to ld.
/* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
size_t len, alloc;
};
-static void
+static bfd_boolean
gld${EMULATION_NAME}_parse_ld_so_conf
(struct gld${EMULATION_NAME}_ld_so_conf *info, const char *filename);
free (newp);
}
-static void
+static bfd_boolean
gld${EMULATION_NAME}_parse_ld_so_conf
(struct gld${EMULATION_NAME}_ld_so_conf *info, const char *filename)
{
size_t linelen;
if (f == NULL)
- return;
+ return FALSE;
linelen = 256;
line = xmalloc (linelen);
while (! feof (f));
free (line);
fclose (f);
+ return TRUE;
}
static bfd_boolean
char *tmppath;
struct gld${EMULATION_NAME}_ld_so_conf info;
- tmppath = concat (ld_sysroot, "/etc/ld.so.conf", NULL);
info.path = NULL;
info.len = info.alloc = 0;
- gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath);
+ tmppath = concat (ld_sysroot, "${prefix}/etc/ld.so.conf", NULL);
+ if (!gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath))
+ {
+ free (tmppath);
+ tmppath = concat (ld_sysroot, "/etc/ld.so.conf", NULL);
+ gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath);
+ }
free (tmppath);
+
if (info.path)
{
char *d = gld${EMULATION_NAME}_add_sysroot (info.path);