|
--- ./bfd/elfxx-mips.c.orig Wed Nov 13 12:59:20 2002
|
|
+++ ./bfd/elfxx-mips.c Wed Nov 13 13:15:57 2002
|
|
@@ -4794,6 +4794,28 @@
|
|
entries, but not always. */
|
|
local_gotno *= 2;
|
|
|
|
+ /* jbr: THIS IS A COMPLETE HACK. IT MUST BE FIXED!
|
|
+ Don't let the .got section get to be bigger than
|
|
+ 2^15 bytes (i.e., half the size that can be addressed
|
|
+ off of the gp). If it is trying to get that big, it
|
|
+ could be because of a not large number of large static
|
|
+ arrays in the .bss and therefore it doesn't really
|
|
+ need to be that big. We issue a warning and then
|
|
+ reduce the size to 2^15. */
|
|
+ if ((s->_raw_size + local_gotno * MIPS_ELF_GOT_SIZE (dynobj)) > 0x8000) {
|
|
+ (*_bfd_error_handler)
|
|
+ (_(".got wants %d bytes (maybe due to big .bss)"),
|
|
+ s->_raw_size + local_gotno * MIPS_ELF_GOT_SIZE (dynobj));
|
|
+ if (s->_raw_size >= 0x4000)
|
|
+ (*_bfd_error_handler)
|
|
+ (_(".got is too big to fix, try using -G 0 or -xgot"));
|
|
+ else {
|
|
+ (*_bfd_error_handler)
|
|
+ (_("attempting to truncate .got; if you get relocation truncations, try using -G 0 or -xgot"));
|
|
+ local_gotno = (0x8000 - s->_raw_size) / MIPS_ELF_GOT_SIZE (dynobj);
|
|
+ }
|
|
+ }
|
|
+ /* jbr: end of hack */
|
|
g->local_gotno += local_gotno;
|
|
s->_raw_size += local_gotno * MIPS_ELF_GOT_SIZE (dynobj);
|
|
|