aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/elf32.em
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl/elf32.em')
-rw-r--r--ld/emultempl/elf32.em44
1 files changed, 22 insertions, 22 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 492953d..417ac4c 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -7,7 +7,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
- Copyright (C) 1991, 93, 94, 95, 96, 97, 98, 99, 2000
+ Copyright (C) 1991, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
@@ -527,11 +527,26 @@ gld${EMULATION_NAME}_check_needed (s)
if (global_found)
return;
- if (s->filename != NULL
- && strcmp (s->filename, global_needed->name) == 0)
+ if (s->filename != NULL)
{
- global_found = true;
- return;
+ const char *f;
+
+ if (strcmp (s->filename, global_needed->name) == 0)
+ {
+ global_found = true;
+ return;
+ }
+
+ if (s->search_dirs_flag)
+ {
+ f = strrchr (s->filename, '/');
+ if (f != NULL
+ && strcmp (f + 1, global_needed->name) == 0)
+ {
+ global_found = true;
+ return;
+ }
+ }
}
if (s->the_bfd != NULL)
@@ -546,21 +561,6 @@ gld${EMULATION_NAME}_check_needed (s)
return;
}
}
-
- if (s->search_dirs_flag
- && s->filename != NULL
- && strchr (global_needed->name, '/') == NULL)
- {
- const char *f;
-
- f = strrchr (s->filename, '/');
- if (f != NULL
- && strcmp (f + 1, global_needed->name) == 0)
- {
- global_found = true;
- return;
- }
- }
}
EOF
@@ -1030,7 +1030,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
secname = bfd_get_section_name (s->owner, s);
- if (! config.unique_orphan_sections)
+ if (! config.unique_orphan_sections && ! unique_section_p (secname))
{
/* Look through the script to see where to place this section. */
os = lang_output_section_find (secname);
@@ -1075,7 +1075,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
if ((s->flags & SEC_ALLOC) == 0)
;
else if ((s->flags & SEC_LOAD) != 0
- && strncmp (secname, ".note", 4) == 0
+ && strncmp (secname, ".note", 5) == 0
&& HAVE_SECTION (hold_interp, ".interp"))
place = &hold_interp;
else if ((s->flags & SEC_HAS_CONTENTS) == 0