This is the same as 327248 except Arm defining _GLOBAL_OFFSET_TABLE_ to be the base of the .got section as some existing code is relying upon it. For most Targets the _GLOBAL_OFFSET_TABLE_ symbol is expected to be at the start of the .got.plt section so that _GLOBAL_OFFSET_TABLE_[0] = reserved value that is by convention the address of the dynamic section. Previously we had defined _GLOBAL_OFFSET_TABLE_ as either the start or end of the .got section with the intention that the .got.plt section would follow the .got. However this does not always hold with the current default section ordering so _GLOBAL_OFFSET_TABLE_[0] may not be consistent with the reserved first entry of the .got.plt. X86, X86_64 and AArch64 will use the .got.plt. Arm, Mips and Power use .got Fixes PR36555 Differential Revision: https://reviews.llvm.org/D44259 llvm-svn: 327823
57 lines
1.5 KiB
ArmAsm
57 lines
1.5 KiB
ArmAsm
// REQUIRES: x86
|
|
// RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %s -o %t.o
|
|
// RUN: ld.lld --hash-style=sysv %t.o -o %t.so -shared
|
|
// RUN: llvm-readobj -s -l -section-data -r %t.so | FileCheck %s
|
|
|
|
// CHECK: Name: .got.plt
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
// CHECK-NEXT: Flags [
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
// CHECK-NEXT: SHF_WRITE
|
|
// CHECK-NEXT: ]
|
|
// CHECK-NEXT: Address:
|
|
// CHECK-NEXT: Offset:
|
|
// CHECK-NEXT: Size:
|
|
// CHECK-NEXT: Link:
|
|
// CHECK-NEXT: Info:
|
|
// CHECK-NEXT: AddressAlignment:
|
|
// CHECK-NEXT: EntrySize:
|
|
// CHECK-NEXT: SectionData (
|
|
// CHECK-NEXT: 0000: 00300000 00000000 00000000
|
|
// CHECK-NEXT: )
|
|
|
|
// CHECK: Name: .got
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
// CHECK-NEXT: Flags [
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
// CHECK-NEXT: SHF_WRITE
|
|
// CHECK-NEXT: ]
|
|
// CHECK-NEXT: Address:
|
|
// CHECK-NEXT: Offset:
|
|
// CHECK-NEXT: Size:
|
|
// CHECK-NEXT: Link:
|
|
// CHECK-NEXT: Info:
|
|
// CHECK-NEXT: AddressAlignment:
|
|
// CHECK-NEXT: EntrySize:
|
|
// CHECK-NEXT: SectionData (
|
|
// CHECK-NEXT: 0000: 00300000
|
|
// CHECK-NEXT: )
|
|
|
|
// CHECK: Relocations [
|
|
// CHECK-NEXT: Section ({{.*}}) .rel.dyn {
|
|
// CHECK-NEXT: 0x3050 R_386_RELATIVE - 0x0
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK: Type: PT_DYNAMIC
|
|
// CHECK-NEXT: Offset: 0x3000
|
|
// CHECK-NEXT: VirtualAddress: 0x3000
|
|
// CHECK-NEXT: PhysicalAddress: 0x3000
|
|
|
|
calll .L0$pb
|
|
.L0$pb:
|
|
popl %eax
|
|
.Ltmp0:
|
|
addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax
|
|
movl _DYNAMIC@GOT(%eax), %eax
|