aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Carlsson <ulfc@engr.sgi.com>2000-06-17 09:47:15 +0000
committerUlf Carlsson <ulfc@engr.sgi.com>2000-06-17 09:47:15 +0000
commit9a8f3bb7343e9c6e7aebdafc19b34a6d1dad0784 (patch)
tree2c6245ed2bd34ab53d7bdca3d79d87d8acfa05c3
parent4a7f7ba82c16a22762b99f4d6b4510e396fc7791 (diff)
downloadgdb-9a8f3bb7343e9c6e7aebdafc19b34a6d1dad0784.zip
gdb-9a8f3bb7343e9c6e7aebdafc19b34a6d1dad0784.tar.gz
gdb-9a8f3bb7343e9c6e7aebdafc19b34a6d1dad0784.tar.bz2
2000-06-17 Ulf Carlsson <ulfc@engr.sgi.com>
* elf32-mips.c (mips_elf_calculate_relocation): Explicitly write GOT entries if we're doing a static link or -Bsymbolic link.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-mips.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 83087a4..e50360c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-17 Ulf Carlsson <ulfc@engr.sgi.com>
+
+ * elf32-mips.c (mips_elf_calculate_relocation): Explicitly write
+ GOT entries if we're doing a static link or -Bsymbolic link.
+
2000-06-15 Ulf Carlsson <ulfc@engr.sgi.com>
* elflink.h (elf_link_adjust_relocs): Check for and call backend
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 29e260e..c4b5ff4 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -6026,6 +6026,19 @@ mips_elf_calculate_relocation (abfd,
g = mips_elf_global_got_index
(elf_hash_table (info)->dynobj,
(struct elf_link_hash_entry*) h);
+ if (! elf_hash_table(info)->dynamic_sections_created
+ || (info->shared
+ && (info->symbolic || h->root.dynindx == -1)
+ && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ {
+ /* This is a static link or a -Bsymbolic link. The
+ symbol is defined locally, or was forced to be local.
+ We must initialize this entry in the GOT. */
+ asection *sgot = mips_elf_got_section(elf_hash_table
+ (info)->dynobj);
+ MIPS_ELF_PUT_WORD (elf_hash_table (info)->dynobj,
+ symbol + addend, sgot->contents + g);
+ }
}
else if (r_type == R_MIPS_GOT16)
/* There's no need to create a local GOT entry here; the