summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2004-02-09 08:04:00 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2004-02-09 08:04:00 +0000
commitfa29cdf548c4d5ea411b9dce9dd0f0a2a0d4e8c2 (patch)
tree94230a198163fb228fb852bc948757d64a9668bc /bfd/elf.c
parent0b5ca37c078df2e9fbd74aeec5280dff46cc12fc (diff)
downloadgdb-fa29cdf548c4d5ea411b9dce9dd0f0a2a0d4e8c2.tar.gz
* 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 cd107bda035..82f778b308b 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;