2016-08-30 17:54:01 +08:00
|
|
|
# REQUIRES: x86
|
2018-03-01 09:19:12 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/addr.s -o %t
|
|
|
|
# RUN: ld.lld %t --script %s -o %t1
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump --section-headers %t1 | FileCheck %s
|
2016-08-30 17:54:01 +08:00
|
|
|
|
|
|
|
# CHECK: Sections:
|
2019-01-28 23:03:47 +08:00
|
|
|
# CHECK-NEXT: Idx Name Size VMA Type
|
2016-08-30 17:54:01 +08:00
|
|
|
# CHECK-NEXT: 0 00000000 0000000000000000
|
2018-06-23 08:15:23 +08:00
|
|
|
# CHECK-NEXT: 1 .text 00000000 0000000000001000 TEXT
|
2016-08-30 17:54:01 +08:00
|
|
|
# CHECK-NEXT: 2 .foo.1 00000008 0000000000001000 DATA
|
|
|
|
# CHECK-NEXT: 3 .foo.2 00000008 0000000000001100 DATA
|
|
|
|
# CHECK-NEXT: 4 .foo.3 00000008 0000000000001108 DATA
|
|
|
|
|
2018-03-01 09:19:12 +08:00
|
|
|
SECTIONS {
|
|
|
|
. = 0x1000;
|
|
|
|
.text : { *(.text*) }
|
|
|
|
.foo.1 : { *(.foo.1) }
|
|
|
|
.foo.2 ADDR(.foo.1) + 0x100 : { *(.foo.2) }
|
|
|
|
.foo.3 : { *(.foo.3) }
|
|
|
|
}
|