


> if -msecure-plt and -mbss-plt are supposed to affect > this change needs to be conditional on !mbss-plt too. +#define LINK_SECURE_PLT_DEFAULT_SPEC "-secure-plt"ĭiff -git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt" +++ -18,3 +18,4 along with GCC see the file COPYING3. diff -git a/gcc/config/rs6000/secureplt.h b/gcc/config/rs6000/secureplt.h (SUBTARGET_EXTRA_SPECS): Add "link_secure_plt_default". (LINK_SPEC): Add %(link_secure_plt_default). * config/rs6000/sysv4.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define. * config/rs6000/secureplt.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define. linking a main executable with non-secureplt * linking non-secureplt code with secureplt gcc will emit warningsĪt link time (e.g. Shared objects have PIC code linked in from the compiler start code,īut with -nostartfiles one can create a shared object that is not secure The linker heuristic fails to produce secure plt in the main executable. In (elf/elf-init.oS through libc_nonshared.a), but e.g. Without passing -secure-plt, case (2) can happen to the main executable.Ĭurrently glibc avoids this because there is always PIC code linked Warn in case (1) and produce a binary with secure plt in case (2).
#Msecure help Patch
This patch passes -secure-plt to the linker which makes the linker (2) or all the linked objects are non-PIC or have no relocs,īecause this is the binutils linker behaviour. (1) any of the linked PIC objects have bss plt relocs To: gcc-patches +Cc: David Edelsohn, gregor.richards, Rich FelkerĪ powerpc toolchain built with (or without) -enable-securepltĬurrently creates a binary that uses bss plt if 11:12 ` Alan Modra 0 siblings, 2 replies 9+ messages in threadįrom: Szabolcs Nagy 17:51 UTC ( / raw) Pass -secure-plt to the linker public inbox for help / color / mirror / Atom feed * Pass -secure-plt to the linker 17:51 Szabolcs Nagy
