diff --git a/ld/ChangeLog b/ld/ChangeLog index c806643033..c14c479de6 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2018-01-29 Eric Botcazou + + * testsuite/ld-elf/shared.exp (AFLAGS_PIC): Define on SPARC. + (pr22269-1): Pass AFLAGS_PIC to the assembler. + 2018-01-29 Eric Botcazou * testsuite/ld-elf/pr22450.d: Remove reference to SPARC64. diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 5c4d78aa2d..9b9cbaadfd 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -42,6 +42,10 @@ set AFLAGS_PIC "" 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 "" @@ -577,7 +581,7 @@ run_ld_link_tests [list \ "Build pr22269-1" \ "-pie -e _start --no-dynamic-linker -z text" \ "" \ - "" \ + "$AFLAGS_PIC" \ { pr22269-1.c } \ {{readelf -rW pr22269-1.rd}} \ "pr22269-1" \