brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 1113a79 Raw
44 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o3# RUN: echo 'SECTIONS { \4# RUN:   . = SIZEOF_HEADERS; \5# RUN:   .text : { *(.text) } \6# RUN:   .tbss : { __tbss_start = .; *(.tbss) __tbss_end = .; } \7# RUN:   second_tbss : { second_tbss_start = .; *(second_tbss) second_tbss_end = .; } \8# RUN:   bar : { *(bar) } \9# RUN: }' > %t.lds10# RUN: ld.lld -T %t.lds %t.o -o %t111# RUN: llvm-readelf -S -s %t1 | FileCheck %s12 13# RUN: echo 'PHDRS { text PT_LOAD; }' > %th.lds14# RUN: cat %th.lds %t.lds > %t2.lds15# RUN: ld.lld -T %t.lds %t.o -o %t216# RUN: llvm-readelf -S -s %t2 | FileCheck %s17 18## Test that a tbss section doesn't affect the start address of the next section.19 20# CHECK: Name        Type     Address              Off                Size   ES Flg21# CHECK: .tbss       NOBITS   [[#%x,ADDR:]]        [[#%x,OFF:]]       000004 00 WAT22# CHECK: second_tbss NOBITS   {{0+}}[[#%x,ADDR+4]] {{0+}}[[#%x,OFF]]  000001 00 WAT23# CHECK: bar         PROGBITS {{0+}}[[#%x,ADDR]]   {{0+}}[[#%x,OFF]]  000004 00  WA24 25## Test that . in a tbss section represents the current location, even if the26## address will be reset.27 28# CHECK: Value                {{.*}} Name29# CHECK: {{0+}}[[#%x,ADDR]]   {{.*}} __tbss_start30# CHECK: {{0+}}[[#%x,ADDR+4]] {{.*}} __tbss_end31# CHECK: {{0+}}[[#%x,ADDR+4]] {{.*}} second_tbss_start32# CHECK: {{0+}}[[#%x,ADDR+5]] {{.*}} second_tbss_end33 34.globl _start35_start:36  nop37 38.section .tbss,"awT",@nobits39  .long 040.section second_tbss,"awT",@nobits41  .byte 042.section bar, "aw"43  .long 044