0005-staticpie.diff 1022 B

12345678910111213141516171819202122232425262728
  1. diff --git a/gcc/config/linux.h b/gcc/config/linux.h
  2. index 1967b46..39f8cb4 100644
  3. --- a/gcc/config/linux.h
  4. +++ b/gcc/config/linux.h
  5. @@ -41,8 +41,8 @@ Boston, MA 02110-1301, USA. */
  6. #undef STARTFILE_SPEC
  7. #if defined HAVE_LD_PIE
  8. #define STARTFILE_SPEC \
  9. - "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
  10. - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
  11. + "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:%{static:rcrt1.o%s;:Scrt1.o%s};:crt1.o%s}} \
  12. + crti.o%s %{shared|pie:crtbeginS.o%s;static:crtbeginT.o%s;:crtbegin.o%s}"
  13. #else
  14. #define STARTFILE_SPEC \
  15. "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
  16. diff --git a/gcc/gcc.c b/gcc/gcc.c
  17. index 0b5ee4b..41d17a5 100644
  18. --- a/gcc/gcc.c
  19. +++ b/gcc/gcc.c
  20. @@ -684,7 +684,7 @@ proper position among the other output files. */
  21. #ifndef LINK_PIE_SPEC
  22. #ifdef HAVE_LD_PIE
  23. -#define LINK_PIE_SPEC "%{pie:-pie} "
  24. +#define LINK_PIE_SPEC "%{pie:-pie %{static:--no-dynamic-linker}} "
  25. #else
  26. #define LINK_PIE_SPEC "%{pie:} "
  27. #endif