diff options
author | H.J. Lu <hjl@lucon.org> | 2001-06-08 15:30:52 +0000 |
---|---|---|
committer | H.J. Lu <hjl@lucon.org> | 2001-06-08 15:30:52 +0000 |
commit | a19e5fbf07da32762e0232d2515e4aefdb627bc4 (patch) | |
tree | 7bcf76dae5470bffe43298dbc4c8fde8164ff771 /bfd | |
parent | 5c1dcb3bfeb3699a9ab282eb092b41134879170f (diff) | |
download | gdb-a19e5fbf07da32762e0232d2515e4aefdb627bc4.tar.gz |
2001-06-08 H.J. Lu <hjl@gnu.org>
* elf.c (swap_out_syms): Keep names for global section symbols.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 4 | ||||
-rw-r--r-- | bfd/elf.c | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 21cf85cca3d..b60ba18fdbd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2001-06-08 H.J. Lu <hjl@gnu.org> + + * elf.c (swap_out_syms): Keep names for global section symbols. + 2001-06-07 H.J. Lu <hjl@gnu.org> * config.bfd: Put back ecoff for Linux/mips. Firmwares on some diff --git a/bfd/elf.c b/bfd/elf.c index fc31cdc8e1f..665d99fefa3 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -4394,9 +4394,9 @@ swap_out_syms (abfd, sttp, relocatable_p) flagword flags = syms[idx]->flags; int type; - if ((flags & BSF_SECTION_SYM) != 0) + if ((flags & (BSF_SECTION_SYM | BSF_GLOBAL)) == BSF_SECTION_SYM) { - /* Section symbols have no name. */ + /* Local section symbols have no name. */ sym.st_name = 0; } else @@ -4505,7 +4505,12 @@ 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); + { + if (flags & BSF_GLOBAL) + sym.st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); + else + sym.st_info = ELF_ST_INFO (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)) |