aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2000-10-07 12:52:15 +0000
committerAlan Modra <amodra@gmail.com>2000-10-07 12:52:15 +0000
commit44852b190c1f9b646fa36abd214dab0f5f82e773 (patch)
tree6067b0be5cd8c5f898066e78270b55a350e7ba6b /gas
parentd742f2c2204a85d8196bcda35f22fa2da93aed70 (diff)
downloadfsf-binutils-gdb-44852b190c1f9b646fa36abd214dab0f5f82e773.zip
fsf-binutils-gdb-44852b190c1f9b646fa36abd214dab0f5f82e773.tar.gz
fsf-binutils-gdb-44852b190c1f9b646fa36abd214dab0f5f82e773.tar.bz2
Make elf section symbols global for link-once sections.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/obj-elf.c15
-rw-r--r--gas/write.c2
3 files changed, 23 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ff9c3b8..7533a9e 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2000-10-07 Alan Modra <alan@linuxcare.com.au>
+
+ * write.c (write_relocs): Fix a comment.
+
+ * config/obj-elf.c (elf_frob_symbol): Make section syms global on
+ link-once sections.
+
2000-10-05 Jim Wilson <wilson@cygnus.com>
* config/tc-ia64.c (resources_match): Handle IA64_RS_PRr.
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 4e7f3a36..0f49ab6 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1742,6 +1742,21 @@ elf_frob_symbol (symp, puntp)
&& S_IS_DEFINED (symp))
symbol_get_bfdsym (symp)->flags |= BSF_OBJECT;
#endif
+
+ if (symbol_section_p (symp))
+ {
+ asection *symsec = S_GET_SEGMENT (symp);
+
+ if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) != 0
+ || strncmp (segment_name (symsec), ".gnu.linkonce",
+ sizeof ".gnu.linkonce" - 1) == 0)
+ {
+ /* Make section syms global on ELF linkonce sections.
+ This way, any reference to the section symbol will
+ resolve to the section that actually stays in. */
+ S_SET_EXTERNAL (symp);
+ }
+ }
}
void
diff --git a/gas/write.c b/gas/write.c
index 907ba2f..802d461 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1008,7 +1008,7 @@ write_relocs (abfd, sec, xxx)
}
/* If this is an undefined symbol which was equated to another
- symbol, then use generate the reloc against the latter symbol
+ symbol, then generate the reloc against the latter symbol
rather than the former. */
sym = fixp->fx_addsy;
while (symbol_equated_p (sym)