820-no-mips-empic-relocs.patch 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. From: cgd at broadcom dot com
  2. To: gcc-patches at gcc dot gnu dot org
  3. Cc: mark at codesourcery dot com
  4. Date: 13 Jun 2004 22:51:30 -0700
  5. Subject: [trunk + 3.4-branch RFA] don't use empic relocs for mips-linuxeh
  6. This patch changes mips-linux to avoid using embedded-pic relocs for
  7. its eh data. (Support for generating these for new code is removed in
  8. current binutils srcs.)
  9. Relating to this, previously, mips-linux and mips64-linux would use
  10. different representations for their EH data (even for mips64-linux o32
  11. abi), due to the mips64-linux n32/64 BFDs not supporting the
  12. embedded-pic relocs. This was a bug.
  13. For more explanation, see the thread of the URL quoted in the comment
  14. in linux.h.
  15. Tested the same w/ sources of about a week ago for c/c++ for
  16. mips-linux (native) before/after. Also verified .o compatibility
  17. before/after just to be sure.
  18. I'd like this approved for the branch as well, so 3.4.1 will work
  19. nicely w/ the next major binutils release.
  20. thanks,
  21. chris
  22. 2004-06-13 Chris Demetriou <cgd@broadcom.com>
  23. * config/mips/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): Redefine
  24. to return DW_EH_PE_absptr.
  25. * config/mips/linux64.h (ASM_PREFERRED_EH_DATA_FORMAT): Remove.
  26. Index: config/mips/linux.h
  27. ===================================================================
  28. RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
  29. retrieving revision 1.77
  30. diff -u -p -r1.77 linux.h
  31. --- gcc/gcc/config/mips/linux.h 19 Feb 2004 22:07:51 -0000 1.77
  32. +++ gcc/gcc/config/mips/linux.h 14 Jun 2004 05:49:51 -0000
  33. @@ -170,10 +170,11 @@ Boston, MA 02111-1307, USA. */
  34. #undef FUNCTION_NAME_ALREADY_DECLARED
  35. #define FUNCTION_NAME_ALREADY_DECLARED 1
  36. -#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
  37. - (flag_pic \
  38. - ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\
  39. - : DW_EH_PE_absptr)
  40. +/* If possible, we should attempt to use GP-relative relocs for this
  41. + (see <a href="http://sources.redhat.com/ml/binutils/2004-05/msg00227.html">http://sources.redhat.com/ml/binutils/2004-05/msg00227.html</a>).
  42. + However, until that is implement, this just uses standard, absolute
  43. + references. */
  44. +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr
  45. /* The glibc _mcount stub will save $v0 for us. Don't mess with saving
  46. it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
  47. Index: config/mips/linux64.h
  48. ===================================================================
  49. RCS file: /cvs/gcc/gcc/gcc/config/mips/linux64.h,v
  50. retrieving revision 1.7
  51. diff -u -p -r1.7 linux64.h
  52. --- gcc/gcc/config/mips/linux64.h 18 Feb 2004 15:05:10 -0000 1.7
  53. +++ gcc/gcc/config/mips/linux64.h 14 Jun 2004 05:49:51 -0000
  54. @@ -81,14 +81,6 @@ Boston, MA 02111-1307, USA. */
  55. specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
  56. #define DWARF_OFFSET_SIZE PTR_SIZE
  57. -#undef ASM_PREFERRED_EH_DATA_FORMAT
  58. -#if 0 /* We can't use relative addressing modes on NEWABI :-( */
  59. -#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
  60. - (flag_pic \
  61. - ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_sdata4 \
  62. - : DW_EH_PE_absptr)
  63. -#endif
  64. -
  65. /* GNU/Linux doesn't use the same floating-point format that IRIX uses
  66. for long double. There's no need to override this here, since
  67. ieee_quad_format is the default, but let's put this here to make