diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 210b4d1eb1a7a..cb8f2f125eebb 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -210,10 +210,10 @@ bool lld::elf::needsGot(RelExpr expr) { // True if this expression is of the form Sym - X, where X is a position in the // file (PC, or GOT for example). static bool isRelExpr(RelExpr expr) { - return oneof( - expr); + return oneof(expr); } static RelExpr toPlt(RelExpr expr) { diff --git a/lld/test/ELF/arm-adr.s b/lld/test/ELF/arm-adr.s index 05e8cc2f92db3..fee78f97a12e8 100644 --- a/lld/test/ELF/arm-adr.s +++ b/lld/test/ELF/arm-adr.s @@ -1,6 +1,8 @@ // REQUIRES: arm // RUN: llvm-mc --triple=armv7a-none-eabi --arm-add-build-attributes -filetype=obj -o %t.o %s // RUN: ld.lld %t.o -o %t +/// R_ARM_ALU_PC_G0 referencing a non-preemptible symbol can be used in PIC links. +// RUN: ld.lld %t.o --shared -o /dev/null // RUN: llvm-objdump -d --no-show-raw-insn --triple=armv7a-none-eabi %t | FileCheck %s /// Test the short range cases of R_ARM_ALU_PC_G0. The range of the instruction