52 lines · plain
1# REQUIRES: x862## Test st_value of the STT_SECTION symbol equals the output section address,3## instead of the first input section address.4 5# RUN: split-file %s %t6# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/asm -o %t.o7 8# RUN: ld.lld --emit-relocs -T %t/lds %t.o -o %t.out9# RUN: llvm-readelf -S -r -s %t.out | FileCheck %s --check-prefix=EXE10 11## In -r mode, section addresses are zeros, hence the st_value fields of12## STT_SECTION are zeros.13# RUN: ld.lld -r -T %t/lds %t.o -o %t.ro14# RUN: llvm-readelf -S -r -s %t.ro | FileCheck %s --check-prefix=RO15 16# EXE: [Nr] Name Type Address17# EXE-NEXT: [ 0]18# EXE-NEXT: [ 1] .text PROGBITS 000000000000000019# EXE-NEXT: [ 2] .bss NOBITS 000000000000000a20 21# EXE: R_X86_64_64 {{.*}} .bss + 122 23# EXE: Symbol table '.symtab' contains 4 entries:24# EXE-NEXT: Num: Value Size Type Bind Vis Ndx Name25# EXE-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND26# EXE-NEXT: 1: 000000000000000a 0 SECTION LOCAL DEFAULT 2 .bss27# EXE-NEXT: 2: 0000000000000000 0 SECTION LOCAL DEFAULT 1 .text28# EXE-NEXT: 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 .comment29 30# RO: [Nr] Name Type Address31# RO-NEXT: [ 0]32# RO-NEXT: [ 1] .bss NOBITS 000000000000000033 34# RO: R_X86_64_64 {{.*}} .bss + 135 36# RO: Symbol table '.symtab' contains 3 entries:37# RO-NEXT: Num: Value Size Type Bind Vis Ndx Name38# RO-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND39# RO-NEXT: 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 .bss40# RO-NEXT: 2: 0000000000000000 0 SECTION LOCAL DEFAULT 2 .text41 42#--- asm43movabsq .bss, %rax44 45.bss46.byte 047 48#--- lds49SECTIONS {50 .bss : { BYTE(0) *(.bss) }51}52