aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.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/elfxx-mips.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/elfxx-mips.c')
-rw-r--r--bfd/elfxx-mips.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 7bcdb11..a296458 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -4271,6 +4271,26 @@ _bfd_mips_elf_symbol_processing (bfd *abfd, asymbol *asym)
}
}
+/* There appears to be a bug in the MIPSpro linker that causes GOT_DISP
+ relocations against two unnamed section symbols to resolve to the
+ same address. For example, if we have code like:
+
+ lw $4,%got_disp(.data)($gp)
+ lw $25,%got_disp(.text)($gp)
+ jalr $25
+
+ then the linker will resolve both relocations to .data and the program
+ will jump there rather than to .text.
+
+ We can work around this problem by giving names to local section symbols.
+ This is also what the MIPSpro tools do. */
+
+bfd_boolean
+_bfd_mips_elf_name_local_section_symbols (bfd *abfd)
+{
+ return SGI_COMPAT (abfd);
+}
+
/* Work over a section just before writing it out. This routine is
used by both the 32-bit and the 64-bit ABI. FIXME: We recognize
sections that need the SHF_MIPS_GPREL flag by name; there has to be