forked from OSchip/llvm-project
Don't create a got entry if we optimize it out.
llvm-svn: 263669
This commit is contained in:
parent
6cec10572f
commit
48b9102a7a
|
@ -1319,8 +1319,9 @@ bool AArch64TargetInfo::needsCopyRelImpl(uint32_t Type) const {
|
|||
|
||||
bool AArch64TargetInfo::needsGot(uint32_t Type, SymbolBody &S) const {
|
||||
switch (Type) {
|
||||
case R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
|
||||
case R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
|
||||
return !canRelaxTls(Type, &S);
|
||||
case R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
|
||||
case R_AARCH64_ADR_GOT_PAGE:
|
||||
case R_AARCH64_LD64_GOT_LO12_NC:
|
||||
return true;
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# REQUIRES: aarch64
|
||||
# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %t.o
|
||||
# RUN: ld.lld %t.o -o %t
|
||||
# RUN: llvm-readobj -s %t | FileCheck %s
|
||||
|
||||
# CHECK-NOT: Name: .got
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
adrp x0, :gottprel:foo
|
||||
|
||||
.global foo
|
||||
.section .tdata,"awT",%progbits
|
||||
.align 2
|
||||
.type foo, %object
|
||||
.size foo, 4
|
||||
foo:
|
||||
.word 5
|
Loading…
Reference in New Issue