- Update to binutils 2.21.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=33
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
Index: ld/emultempl/elf32.em
|
||||
===================================================================
|
||||
--- ld/emultempl/elf32.em.orig 2009-11-23 14:02:48.000000000 +0100
|
||||
+++ ld/emultempl/elf32.em 2009-11-23 14:03:07.000000000 +0100
|
||||
@@ -1394,15 +1394,46 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" !=
|
||||
--- ld/emultempl/elf32.em.orig 2010-10-29 14:10:36.000000000 +0200
|
||||
+++ ld/emultempl/elf32.em 2011-01-10 17:42:31.000000000 +0100
|
||||
@@ -1432,8 +1432,38 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" !=
|
||||
else
|
||||
ELF_INTERPRETER_SET_DEFAULT=
|
||||
fi
|
||||
@@ -11,110 +11,109 @@ Index: ld/emultempl/elf32.em
|
||||
+ for path in $NATIVE_LIB_DIRS; do
|
||||
+ libpath_nl="$libpath_nl\n$path"
|
||||
+ done
|
||||
+
|
||||
fragment <<EOF
|
||||
|
||||
+static int
|
||||
+gld${EMULATION_NAME}_is_contained (const char *path, const char *dc)
|
||||
+{
|
||||
+ while (*dc)
|
||||
+ while (*dc)
|
||||
+ {
|
||||
+ const char *pc = path;
|
||||
+
|
||||
+ while (*dc && *pc && *dc == *pc && *dc != '\n'
|
||||
+ && *pc != ':' && *dc != '=')
|
||||
+ {
|
||||
+ dc++;
|
||||
+ pc++;
|
||||
+ }
|
||||
+ && *pc != ':' && *dc != '=')
|
||||
+ {
|
||||
+ dc++;
|
||||
+ pc++;
|
||||
+ }
|
||||
+ if ((*pc == 0 || *pc == ':') && (*dc == '\n' || *dc == '=' || *dc == 0))
|
||||
+ return 1;
|
||||
+ return 1;
|
||||
+
|
||||
+ while (*dc && *dc != '\n')
|
||||
+ dc++;
|
||||
+ dc++;
|
||||
+ if (*dc == '\n')
|
||||
+ dc++;
|
||||
+ dc++;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* This is called after the sections have been attached to output
|
||||
sections, but before any sizes or addresses have been set. */
|
||||
|
||||
/* used by before_allocation and handle_option. */
|
||||
static void
|
||||
gld${EMULATION_NAME}_append_to_separated_string (char **to, char *op_arg)
|
||||
@@ -1480,7 +1510,7 @@ gld${EMULATION_NAME}_append_to_separated
|
||||
static void
|
||||
gld${EMULATION_NAME}_before_allocation (void)
|
||||
{
|
||||
- const char *rpath;
|
||||
+ char *rpath;
|
||||
asection *sinterp;
|
||||
bfd *abfd;
|
||||
|
||||
if (link_info.hash->type == bfd_link_elf_hash_table)
|
||||
@@ -1417,7 +1448,66 @@ gld${EMULATION_NAME}_before_allocation (
|
||||
@@ -1496,7 +1526,65 @@ gld${EMULATION_NAME}_before_allocation (
|
||||
by dynamic linking. */
|
||||
rpath = command_line.rpath;
|
||||
if (rpath == NULL)
|
||||
- rpath = (const char *) getenv ("LD_RUN_PATH");
|
||||
+ rpath = getenv ("LD_RUN_PATH");
|
||||
+
|
||||
+ if (rpath != NULL && getenv ("SUSE_IGNORED_RPATHS"))
|
||||
+ if (rpath != NULL && getenv ("SUSE_IGNORED_RPATHS"))
|
||||
+ {
|
||||
+ char *dirs = 0;
|
||||
+ FILE *ldso = fopen (getenv ("SUSE_IGNORED_RPATHS"), "r");
|
||||
+ if (ldso)
|
||||
+ {
|
||||
+ off_t endcur = 0;
|
||||
+ fseek (ldso, 0, SEEK_END);
|
||||
+ endcur = ftell (ldso);
|
||||
+ fseek (ldso, 0, SEEK_SET);
|
||||
+ dirs = xmalloc (endcur);
|
||||
+ if (fread (dirs, 1, endcur, ldso) != (size_t) endcur)
|
||||
+ {
|
||||
+ free (dirs);
|
||||
+ dirs = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ if (ldso)
|
||||
+ {
|
||||
+ off_t endcur = 0;
|
||||
+ fseek (ldso, 0, SEEK_END);
|
||||
+ endcur = ftell (ldso);
|
||||
+ fseek (ldso, 0, SEEK_SET);
|
||||
+ dirs = xmalloc (endcur);
|
||||
+ if (fread (dirs, 1, endcur, ldso) != (size_t) endcur)
|
||||
+ {
|
||||
+ free (dirs);
|
||||
+ dirs = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ if (dirs)
|
||||
+ {
|
||||
+ char *cr;
|
||||
+ rpath = xstrdup (rpath);
|
||||
+ cr = rpath; /* cursor read */
|
||||
+ {
|
||||
+ char *cr;
|
||||
+ rpath = xstrdup (rpath);
|
||||
+ cr = rpath; /* cursor read */
|
||||
+
|
||||
+ while (*cr)
|
||||
+ while (*cr)
|
||||
+ {
|
||||
+ if (gld${EMULATION_NAME}_is_contained (cr, dirs)
|
||||
+ || gld${EMULATION_NAME}_is_contained (cr, "$libpath_nl"))
|
||||
+ {
|
||||
+ char *cc = cr, *cw = cr;
|
||||
+ while (*cc && *cc != ':')
|
||||
+ cc++;
|
||||
+ if (*cc == ':')
|
||||
+ if (gld${EMULATION_NAME}_is_contained (cr, dirs)
|
||||
+ || gld${EMULATION_NAME}_is_contained (cr, "$libpath_nl"))
|
||||
+ {
|
||||
+ char *cc = cr, *cw = cr;
|
||||
+ while (*cc && *cc != ':')
|
||||
+ cc++;
|
||||
+ if (*cc == ':')
|
||||
+ {
|
||||
+ cc++;
|
||||
+ for (; *cc; cc++, cw++)
|
||||
+ *cw = *cc;
|
||||
+ cc++;
|
||||
+ for (; *cc; cc++, cw++)
|
||||
+ *cw = *cc;
|
||||
+ }
|
||||
+ else if (cw > rpath)
|
||||
+ cw[-1] = 0;
|
||||
+
|
||||
+ *cw = 0;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ while (*cr && *cr != ':')
|
||||
+ cr++;
|
||||
+ if (*cr == ':')
|
||||
+ cr++;
|
||||
+ }
|
||||
+ }
|
||||
+ if (*rpath == '\0')
|
||||
+ {
|
||||
+ free (rpath);
|
||||
+ rpath = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ *cw = 0;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ while (*cr && *cr != ':')
|
||||
+ cr++;
|
||||
+ if (*cr == ':')
|
||||
+ cr++;
|
||||
+ }
|
||||
+ }
|
||||
+ if (*rpath == '\0')
|
||||
+ {
|
||||
+ free (rpath);
|
||||
+ rpath = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (! (bfd_elf_size_dynamic_sections
|
||||
(link_info.output_bfd, command_line.soname, rpath,
|
||||
command_line.filter_shlib,
|
||||
|
||||
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next)
|
||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
||||
|
Reference in New Issue
Block a user