0020-static-pie-support.diff 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
  2. index b0bf40a..d4b56fe 100644
  3. --- a/gcc/config/gnu-user.h
  4. +++ b/gcc/config/gnu-user.h
  5. @@ -51,10 +51,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  6. #if defined HAVE_LD_PIE
  7. #define GNU_USER_TARGET_STARTFILE_SPEC \
  8. "%{!shared: %{pg|p|profile:gcrt1.o%s;: \
  9. - %{" PIE_SPEC ":Scrt1.o%s} %{" NO_PIE_SPEC ":crt1.o%s}}} \
  10. - crti.o%s %{static:crtbeginT.o%s;: %{shared:crtbeginS.o%s} \
  11. + %{" PIE_SPEC ":%{static:rcrt1.o%s;:Scrt1.o%s}} %{" NO_PIE_SPEC ":crt1.o%s}}} \
  12. + crti.o%s %{shared:crtbeginS.o%s;: \
  13. %{" PIE_SPEC ":crtbeginS.o%s} \
  14. - %{" NO_PIE_SPEC ":crtbegin.o%s}} \
  15. + %{" NO_PIE_SPEC ":%{static:crtbeginT.o%s;:crtbegin.o%s}}} \
  16. %{fvtable-verify=none:%s; \
  17. fvtable-verify=preinit:vtv_start_preinit.o%s; \
  18. fvtable-verify=std:vtv_start.o%s} \
  19. diff --git a/gcc/gcc.c b/gcc/gcc.c
  20. index 0576ea7..0a280e0 100644
  21. --- a/gcc/gcc.c
  22. +++ b/gcc/gcc.c
  23. @@ -870,7 +870,7 @@ proper position among the other output files. */
  24. #endif
  25. #ifdef ENABLE_DEFAULT_PIE
  26. -#define NO_PIE_SPEC "no-pie|static"
  27. +#define NO_PIE_SPEC "no-pie"
  28. #define PIE_SPEC NO_PIE_SPEC "|r|shared:;"
  29. #define NO_FPIE1_SPEC "fno-pie"
  30. #define FPIE1_SPEC NO_FPIE1_SPEC ":;"
  31. @@ -916,7 +916,7 @@ proper position among the other output files. */
  32. #ifndef LINK_PIE_SPEC
  33. #ifdef HAVE_LD_PIE
  34. #ifndef LD_PIE_SPEC
  35. -#define LD_PIE_SPEC "-pie"
  36. +#define LD_PIE_SPEC "-pie %{static:--no-dynamic-linker -Bsymbolic}"
  37. #endif
  38. #else
  39. #define LD_PIE_SPEC ""