brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 81be8a4 Raw
122 lines · plain
1// REQUIRES: x862// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t3// RUN: llvm-readobj --symbols %t | FileCheck  %s4 5// Verify that the symbol _start is in a section with an index >= SHN_LORESERVE.6// CHECK:      Name: _start7// CHECK-NEXT: Value: 0x08// CHECK-NEXT: Size: 09// CHECK-NEXT: Binding: Global10// CHECK-NEXT: Type: None11// CHECK-NEXT: Other: 012// CHECK-NEXT: Section: dm (0xFF00)13 14// RUN: ld.lld %t -o %t215// RUN: llvm-readobj --symbols %t2 | FileCheck --check-prefix=LINKED %s16 17// Test also with a linker script.18// RUN: echo "SECTIONS { . = SIZEOF_HEADERS; .text : { *(.text) } }" > %t.script19// RUN: ld.lld -T %t.script %t -o %t220// RUN: llvm-readobj --symbols %t2 | FileCheck --check-prefix=LINKED %s21 22// Test that _start is in the correct section.23// LINKED:      Name: _start24// LINKED-NEXT: Value: 0x025// LINKED-NEXT: Size: 026// LINKED-NEXT: Binding: Global27// LINKED-NEXT: Type: None28// LINKED-NEXT: Other: 029// LINKED-NEXT: Section: dm30 31.macro gen_sections4 x32        .section a\x33        .section b\x34        .section c\x35        .section d\x36.endm37 38.macro gen_sections8 x39        gen_sections4 a\x40        gen_sections4 b\x41.endm42 43.macro gen_sections16 x44        gen_sections8 a\x45        gen_sections8 b\x46.endm47 48.macro gen_sections32 x49        gen_sections16 a\x50        gen_sections16 b\x51.endm52 53.macro gen_sections64 x54        gen_sections32 a\x55        gen_sections32 b\x56.endm57 58.macro gen_sections128 x59        gen_sections64 a\x60        gen_sections64 b\x61.endm62 63.macro gen_sections256 x64        gen_sections128 a\x65        gen_sections128 b\x66.endm67 68.macro gen_sections512 x69        gen_sections256 a\x70        gen_sections256 b\x71.endm72 73.macro gen_sections1024 x74        gen_sections512 a\x75        gen_sections512 b\x76.endm77 78.macro gen_sections2048 x79        gen_sections1024 a\x80        gen_sections1024 b\x81.endm82 83.macro gen_sections4096 x84        gen_sections2048 a\x85        gen_sections2048 b\x86.endm87 88.macro gen_sections8192 x89        gen_sections4096 a\x90        gen_sections4096 b\x91.endm92 93.macro gen_sections16384 x94        gen_sections8192 a\x95        gen_sections8192 b\x96.endm97 98.macro gen_sections32768 x99        gen_sections16384 a\x100        gen_sections16384 b\x101.endm102 103        .bss104        .section bar105 106gen_sections32768 a107gen_sections16384 b108gen_sections8192 c109gen_sections4096 d110gen_sections2048 e111gen_sections1024 f112gen_sections512 g113gen_sections128 h114gen_sections64 i115gen_sections32 j116gen_sections16 k117gen_sections8 l118gen_sections4 m119 120.global _start121_start:122