mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.3 KiB

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