brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · dd23ed9 Raw
52 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o3 4# RUN: echo "SECTIONS { .text : { *(.text) } foo = .; .bar : { *(.bar) } }" > %t1.script5# RUN: ld.lld -o %t1 --script %t1.script %t.o -shared6# RUN: llvm-readobj --symbols -S --section-data %t1 | FileCheck %s7 8.hidden foo9.long foo - .10 11.section .bar, "a"12.long 013 14# The symbol foo is defined as a position in the file. This means that it is15# not absolute and it is possible to compute the distance from foo to some other16# position in the file. The symbol is not really in any output section, but17# ELF has no magic constant for not absolute, but not in any section.18# Fortunately the value of a symbol in a non relocatable file is a virtual19# address, so the section can be arbitrary.20 21# CHECK:      Section {22# CHECK:        Index:23# CHECK:        Name: .text24# CHECK-NEXT:   Type: SHT_PROGBITS25# CHECK-NEXT:   Flags [26# CHECK-NEXT:     SHF_ALLOC27# CHECK-NEXT:     SHF_EXECINSTR28# CHECK-NEXT:   ]29# CHECK-NEXT:   Address: 0x030# CHECK-NEXT:   Offset:31# CHECK-NEXT:   Size: 432# CHECK-NEXT:   Link:33# CHECK-NEXT:   Info:34# CHECK-NEXT:   AddressAlignment:35# CHECK-NEXT:   EntrySize:36# CHECK-NEXT:   SectionData (37# CHECK-NEXT:     0000: 04000000 |38# CHECK-NEXT:   )39# CHECK-NEXT: }40 41# CHECK:      Symbol {42# CHECK:        Name: foo43# CHECK-NEXT:   Value: 0x444# CHECK-NEXT:   Size: 045# CHECK-NEXT:   Binding: Local46# CHECK-NEXT:   Type: None47# CHECK-NEXT:   Other [48# CHECK-NEXT:     STV_HIDDEN49# CHECK-NEXT:   ]50# CHECK-NEXT:   Section: .text51# CHECK-NEXT: }52