On the SPARC architecture, you need to pass a special flag to GNU as
when you're assembling PIC/PIE code or else you get a wrong relocation
for the GOT symbol.
ld/
* testsuite/ld-elf/shared.exp (AFLAGS_PIC): Define on SPARC.
(pr22269-1): Pass AFLAGS_PIC to the assembler.
+2018-01-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * testsuite/ld-elf/shared.exp (AFLAGS_PIC): Define on SPARC.
+ (pr22269-1): Pass AFLAGS_PIC to the assembler.
+
2018-01-29 Eric Botcazou <ebotcazou@adacore.com>
* testsuite/ld-elf/pr22450.d: Remove reference to SPARC64.
if [istarget "tic6x-*-*"] {
append AFLAGS_PIC " -mpic -mpid=near"
}
+if [istarget "sparc*-*-*"] {
+ append AFLAGS_PIC " -K PIC"
+}
+
# This target requires a non-default emulation for successful shared
# library/executable builds.
set LFLAGS ""
"Build pr22269-1" \
"-pie -e _start --no-dynamic-linker -z text" \
"" \
- "" \
+ "$AFLAGS_PIC" \
{ pr22269-1.c } \
{{readelf -rW pr22269-1.rd}} \
"pr22269-1" \