aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2004-02-09 08:04:00 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2004-02-09 08:04:00 +0000
commit174fd7f9556183397625dbfa99ef68ecd325c74b (patch)
tree0343a185c2e517f52888f5d2fb8e11af23d036b7 /bfd/elf.c
parentedfae06341a087244f28127674aba54f20912885 (diff)
downloadgdb-174fd7f9556183397625dbfa99ef68ecd325c74b.zip
gdb-174fd7f9556183397625dbfa99ef68ecd325c74b.tar.gz
gdb-174fd7f9556183397625dbfa99ef68ecd325c74b.tar.bz2
* bfd-elf.h (elf_backend_name_local_section_symbols): New hook.
* elf.c (swap_out_syms): Use it to decide whether local section symbols should be named. * elfxx-target.h (elf_backend_name_local_section_symbols): New macro. * elfxx-mips.h (_bfd_mips_elf_name_local_section_symbols): Declare. (elf_backend_name_local_section_symbols): Define. * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): New.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index cd107bd..82f778b 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -5261,6 +5261,7 @@ swap_out_syms (bfd *abfd,
char *outbound_shndx;
int idx;
bfd_size_type amt;
+ bfd_boolean name_local_sections;
if (!elf_map_symbols (abfd))
return FALSE;
@@ -5326,6 +5327,10 @@ swap_out_syms (bfd *abfd,
outbound_shndx += sizeof (Elf_External_Sym_Shndx);
}
+ name_local_sections
+ = (bed->elf_backend_name_local_section_symbols
+ && bed->elf_backend_name_local_section_symbols (abfd));
+
syms = bfd_get_outsymbols (abfd);
for (idx = 0; idx < symcount; idx++)
{
@@ -5335,7 +5340,8 @@ swap_out_syms (bfd *abfd,
flagword flags = syms[idx]->flags;
int type;
- if ((flags & (BSF_SECTION_SYM | BSF_GLOBAL)) == BSF_SECTION_SYM)
+ if (!name_local_sections
+ && (flags & (BSF_SECTION_SYM | BSF_GLOBAL)) == BSF_SECTION_SYM)
{
/* Local section symbols have no name. */
sym.st_name = 0;