0019-Revert-RS6000-linux-startfile-endfile.diff 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
  2. index cbee89140dd..de386291a51 100644
  3. --- a/gcc/config/rs6000/sysv4.h
  4. +++ b/gcc/config/rs6000/sysv4.h
  5. @@ -757,34 +757,24 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
  6. #define CRTOFFLOADEND ""
  7. #endif
  8. -/* STARTFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_STARTFILE_SPEC
  9. - but with the mnewlib ecrti.o%s selection substituted for crti.o%s. */
  10. -#define STARTFILE_LINUX_SPEC \
  11. - "%{shared:; \
  12. - pg|p|profile:gcrt1.o%s; \
  13. - static:crt1.o%s; \
  14. - " PIE_SPEC ":Scrt1.o%s; \
  15. - :crt1.o%s} \
  16. - %{mnewlib:ecrti.o%s;:crti.o%s} \
  17. - %{static:crtbeginT.o%s; \
  18. - shared|" PIE_SPEC ":crtbeginS.o%s; \
  19. - :crtbegin.o%s} \
  20. - %{fvtable-verify=none:%s; \
  21. - fvtable-verify=preinit:vtv_start_preinit.o%s; \
  22. - fvtable-verify=std:vtv_start.o%s} \
  23. - " CRTOFFLOADBEGIN
  24. -
  25. -/* ENDFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_ENDFILE_SPEC
  26. - but with the mnewlib ecrtn.o%s selection substituted for crtn.o%s. */
  27. -#define ENDFILE_LINUX_SPEC \
  28. - "%{fvtable-verify=none:%s; \
  29. - fvtable-verify=preinit:vtv_end_preinit.o%s; \
  30. - fvtable-verify=std:vtv_end.o%s} \
  31. - %{static:crtend.o%s; \
  32. - shared|" PIE_SPEC ":crtendS.o%s; \
  33. - :crtend.o%s} \
  34. - %{mnewlib:ecrtn.o%s;:crtn.o%s} \
  35. - " CRTOFFLOADEND
  36. +#ifdef HAVE_LD_PIE
  37. +#define STARTFILE_LINUX_SPEC "\
  38. +%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
  39. +%{mnewlib:ecrti.o%s;:crti.o%s} \
  40. +%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
  41. +" CRTOFFLOADBEGIN
  42. +#else
  43. +#define STARTFILE_LINUX_SPEC "\
  44. +%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
  45. +%{mnewlib:ecrti.o%s;:crti.o%s} \
  46. +%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
  47. +" CRTOFFLOADBEGIN
  48. +#endif
  49. +
  50. +#define ENDFILE_LINUX_SPEC "\
  51. +%{shared|pie:crtendS.o%s;:crtend.o%s} \
  52. +%{mnewlib:ecrtn.o%s;:crtn.o%s} \
  53. +" CRTOFFLOADEND
  54. #define LINK_START_LINUX_SPEC ""