From 6b672ba64246cb748d425d928a4561136f9d0074 Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Sat, 12 Oct 2019 20:53:40 +0000 Subject: [PATCH] [PowerPC] force applications linked with lib CSU to have .got Summary: This forces applications linked with lib CSU to have a .got, fixing binaries linked with LLD9 after secure-plt was enabled on FreeBSD. Submitted by: Alfredo Dal'Ava Junior (alfredo.junior_eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D21476 --- lib/csu/powerpc/crt1.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/csu/powerpc/crt1.c b/lib/csu/powerpc/crt1.c index c5ad29ca1d25..43d7a65aea9e 100644 --- a/lib/csu/powerpc/crt1.c +++ b/lib/csu/powerpc/crt1.c @@ -102,3 +102,9 @@ __asm__(".text"); __asm__("eprol:"); __asm__(".previous"); #endif + +#ifndef PIC +__asm__(".text\n" + "\t.global _GLOBAL_OFFSET_TABLE_\n" + "\t.reloc 0, R_PPC_NONE, _GLOBAL_OFFSET_TABLE_"); +#endif