aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-08-27 00:08:50 +0000
committerMark Mitchell <mark@codesourcery.com>1999-08-27 00:08:50 +0000
commit9458945f8f2c55d6084e0de3ead008c584ebdd9d (patch)
treea28acb9fe1a063d3ad09afd405c8cd96a2102f7b /bfd
parent9a097730233083c99da5bf51aa52e43d64c73f09 (diff)
downloadgdb-9458945f8f2c55d6084e0de3ead008c584ebdd9d.zip
gdb-9458945f8f2c55d6084e0de3ead008c584ebdd9d.tar.gz
gdb-9458945f8f2c55d6084e0de3ead008c584ebdd9d.tar.bz2
* elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate local
GOT entries for GOT16 relocations; they're not required.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-mips.c18
2 files changed, 17 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e5a9e16..b4f9226 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+1999-08-26 Mark Mitchell <mark@codesourcery.com>
+
+ * elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate local
+ GOT entries for GOT16 relocations; they're not required.
+
1999-08-24 Nick Clifton <nickc@cygnus.com>
From a patch submitted by Roland McGrath <roland@baalperazim.frob.com>
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index f18f1fd..3d4ddf5 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -7456,15 +7456,15 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
if (!h && (r_type == R_MIPS_CALL_LO16
|| r_type == R_MIPS_GOT_LO16
- || r_type == R_MIPS_GOT_DISP
- || r_type == R_MIPS_GOT16))
+ || r_type == R_MIPS_GOT_DISP))
{
/* We may need a local GOT entry for this relocation. We
don't count R_MIPS_GOT_PAGE because we can estimate the
maximum number of pages needed by looking at the size of
- the segment. We don't count R_MIPS_GOT_HI16, or
- R_MIPS_CALL_HI16 because these are always followed by an
- R_MIPS_GOT_LO16 or R_MIPS_CALL_LO16.
+ the segment. Similar comments apply to R_MIPS_GOT16. We
+ don't count R_MIPS_GOT_HI16, or R_MIPS_CALL_HI16 because
+ these are always followed by an R_MIPS_GOT_LO16 or
+ R_MIPS_CALL_LO16.
This estimation is very conservative since we can merge
duplicate entries in the GOT. In order to be less
@@ -8003,8 +8003,14 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info)
loadable_size += MIPS_FUNCTION_STUB_SIZE;
/* Assume there are two loadable segments consisting of
- contiguous sections. Is 5 enough? */
+ contiguous sections. Is 5 enough? */
local_gotno = (loadable_size >> 16) + 5;
+ if (IRIX_COMPAT (output_bfd) == ict_irix6)
+ /* It's possible we will need GOT_PAGE entries as well as
+ GOT16 entries. Often, these will be able to share GOT
+ entries, but not always. */
+ local_gotno *= 2;
+
g->local_gotno += local_gotno;
s->_raw_size += local_gotno * MIPS_ELF_GOT_SIZE (dynobj);