aboutsummaryrefslogtreecommitdiff
path: root/bfd
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 /bfd
parentd742f2c2204a85d8196bcda35f22fa2da93aed70 (diff)
downloadgdb-44852b190c1f9b646fa36abd214dab0f5f82e773.zip
gdb-44852b190c1f9b646fa36abd214dab0f5f82e773.tar.gz
gdb-44852b190c1f9b646fa36abd214dab0f5f82e773.tar.bz2
Make elf section symbols global for link-once sections.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elf.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7069fb8..3347191 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2000-10-07 Alan Modra <alan@linuxcare.com.au>
+
+ * elf.c (swap_out_syms): Handle global section symbols.
+
2000-10-05 DJ Delorie <dj@redhat.com>
* peigen.c (_bfd_pei_swap_scnhdr_out): note extended relocs
diff --git a/bfd/elf.c b/bfd/elf.c
index 3aede14..bc8dec7 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4352,8 +4352,9 @@ swap_out_syms (abfd, sttp, relocatable_p)
flagword flags = syms[idx]->flags;
int type;
- if (flags & BSF_SECTION_SYM)
- /* Section symbols have no names. */
+ /* Section symbols usually have no name. The exception is
+ link-once section symbols, which we make global. */
+ if ((flags & (BSF_SECTION_SYM | BSF_GLOBAL)) == BSF_SECTION_SYM)
sym.st_name = 0;
else
{
@@ -4461,7 +4462,8 @@ swap_out_syms (abfd, sttp, relocatable_p)
type = (*bed->elf_backend_get_symbol_type) (&type_ptr->internal_elf_sym, type);
if (flags & BSF_SECTION_SYM)
- sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
+ sym.st_info = ELF_ST_INFO ((flags & BSF_GLOBAL
+ ? STB_GLOBAL : STB_LOCAL), STT_SECTION);
else if (bfd_is_com_section (syms[idx]->section))
sym.st_info = ELF_ST_INFO (STB_GLOBAL, type);
else if (bfd_is_und_section (syms[idx]->section))