// RUN: .arm_caller : { *(.arm_caller) } \
// RUN: .thumb_caller : { *(.thumb_caller) } \
// RUN: .R_ARM_JUMP24_callee_2 : { *(.R_ARM_JUMP24_callee_high) } \
-// RUN: .R_ARM_THM_JUMP_callee_2 : { *(.R_ARM_THM_JUMP_callee_high) } } " > %t.script
+// RUN: .R_ARM_THM_JUMP_callee_2 : { *(.R_ARM_THM_JUMP_callee_high) } \
+// RUN: .got.plt 0x1894 : { } } " > %t.script
// RUN: ld.lld --script %t.script %t -o %t2 2>&1
// RUN: llvm-objdump -d -triple=thumbv7a-none-linux-gnueabi %t2 | FileCheck -check-prefix=CHECK-THUMB -check-prefix=CHECK-ABS-THUMB %s
// RUN: llvm-objdump -d -triple=armv7a-none-linux-gnueabi %t2 | FileCheck -check-prefix=CHECK-ARM -check-prefix=CHECK-ABS-ARM %s
# RUN: echo "SECTIONS { \
# RUN: abc : { } \
# RUN: . = ALIGN(0x1000); \
-# RUN: .text : { *(.text) } \
+# RUN: foo : { *(foo) } \
# RUN: }" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t -shared
# RUN: llvm-objdump -section-headers %t1 | FileCheck %s
# CHECK: Sections:
# CHECK-NEXT: Idx Name Size Address
# CHECK-NEXT: 0 00000000 0000000000000000
-# CHECK-NEXT: 1 .text 00000000 0000000000001000
+# CHECK-NEXT: 1 foo 00000001 0000000000001000
+
+ .section foo, "a"
+ .byte 0
# q2 alignment is greater than q1, so it should have smaller offset
# because of sorting
# CHECK: Section {
-# CHECK: Index: 1
-# CHECK-NEXT: Name: .common (1)
-# CHECK-NEXT: Type: SHT_NOBITS (0x8)
-# CHECK-NEXT: Flags [ (0x3)
-# CHECK-NEXT: SHF_ALLOC (0x2)
-# CHECK-NEXT: SHF_WRITE (0x1)
+# CHECK: Index:
+# CHECK: Name: .common
+# CHECK-NEXT: Type: SHT_NOBITS
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: SHF_ALLOC
+# CHECK-NEXT: SHF_WRITE
# CHECK-NEXT: ]
# CHECK-NEXT: Address: 0x200
-# CHECK-NEXT: Offset: 0x158
+# CHECK-NEXT: Offset: 0x
# CHECK-NEXT: Size: 256
# CHECK-NEXT: Link: 0
# CHECK-NEXT: Info: 0
# CHECK-NEXT: EntrySize: 0
# CHECK-NEXT: }
# CHECK: Symbol {
-# CHECK: Name: q1 (8)
+# CHECK: Name: q1
# CHECK-NEXT: Value: 0x280
# CHECK-NEXT: Size: 128
-# CHECK-NEXT: Binding: Global (0x1)
-# CHECK-NEXT: Type: Object (0x1)
+# CHECK-NEXT: Binding: Global
+# CHECK-NEXT: Type: Object
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .common (0x1)
+# CHECK-NEXT: Section: .common
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: q2 (11)
+# CHECK-NEXT: Name: q2
# CHECK-NEXT: Value: 0x200
# CHECK-NEXT: Size: 128
-# CHECK-NEXT: Binding: Global (0x1)
-# CHECK-NEXT: Type: Object (0x1)
+# CHECK-NEXT: Binding: Global
+# CHECK-NEXT: Type: Object
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .common (0x1)
+# CHECK-NEXT: Section: .common
# CHECK-NEXT: }
.globl _start
# RUN: llvm-readobj -s %t2 | FileCheck %s
# CHECK: Section {
-# CHECK: Index: 4
-# CHECK-NEXT: Name: .got
+# CHECK: Index:
+# CHECK: Name: .got
# CHECK-NEXT: Type: SHT_PROGBITS
# CHECK-NEXT: Flags [
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: EntrySize:
# CHECK-NEXT: }
# CHECK-NEXT: Section {
-# CHECK-NEXT: Index: 5
+# CHECK-NEXT: Index:
# CHECK-NEXT: Name: .got.plt
# CHECK-NEXT: Type: SHT_PROGBITS
# CHECK-NEXT: Flags [
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: echo "SECTIONS { \
+# RUN: .text : { *(.text) } \
# RUN: . = 0x1000; .aaa : ONLY_IF_RO { *(.aaa.*) } \
# RUN: . = 0x2000; .aaa : ONLY_IF_RW { *(.aaa.*) } } " > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# CHECK: Sections:
# CHECK-NEXT: Idx Name Size Address Type
-# CHECK-NEXT: 0 00000000 0000000000000000
-# CHECK-NEXT: 1 .aaa 00000010 0000000000002000 DATA
-# CHECK-NEXT: 2 .text 00000001 0000000000002010 TEXT DATA
-# CHECK-NEXT: 3 .symtab 00000030 0000000000000000
-# CHECK-NEXT: 4 .shstrtab 00000026 0000000000000000
-# CHECK-NEXT: 5 .strtab 00000008 0000000000000000
+# CHECK: .aaa 00000010 0000000000002000 DATA
+
# RUN: echo "SECTIONS { \
+# RUN: .text : { *(.text) } \
# RUN: . = 0x1000; .aaa : ONLY_IF_RW { *(.aaa.*) } \
# RUN: . = 0x2000; .aaa : ONLY_IF_RO { *(.aaa.*) } } " > %t2.script
# RUN: ld.lld -o %t2 --script %t2.script %t
# REV: Sections:
# REV-NEXT: Idx Name Size Address Type
-# REV-NEXT: 0 00000000 0000000000000000
-# REV-NEXT: 1 .aaa 00000010 0000000000001000 DATA
-# REV-NEXT: 2 .text 00000001 0000000000002000 TEXT DATA
-# REV-NEXT: 3 .symtab 00000030 0000000000000000
-# REV-NEXT: 4 .shstrtab 00000026 0000000000000000
-# REV-NEXT: 5 .strtab 00000008 0000000000000000
+# REV: .aaa 00000010 0000000000001000 DATA
.global _start
_start:
# RUN: llvm-objdump -section-headers %t1 | FileCheck %s
# CHECK: Sections:
# CHECK-NEXT: Idx Name Size Address Type
-# CHECK-NEXT: 0 00000000 0000000000000000
-# CHECK-NEXT: 1 .foo 00000008 0000000000000158 DATA
-# CHECK-NEXT: 2 .text 00000001 0000000000000160 TEXT DATA
+# CHECK-NOT: .foo
+# CHECK: .foo 00000008 {{.*}} DATA
+# CHECK-NOT: .foo
+
.global _start
_start:
# BASE: Sections:
# BASE-NEXT: Idx Name Size
# BASE-NEXT: 0 00000000
-# BASE-NEXT: 1 .writable 00000004
-# BASE-NEXT: 2 .readable 00000004
+# BASE: .writable 00000004
+# BASE: .readable 00000004
# RUN: echo "SECTIONS { \
# RUN: .foo : ONLY_IF_RO { *(.foo.*) } \
# NO1: Sections:
# NO1-NEXT: Idx Name Size
# NO1-NEXT: 0 00000000
-# NO1-NEXT: 1 .writable 00000004
-# NO1-NEXT: 2 .readable 00000004
-# NO1-NEXT: 3 .text 00000001
-# NO1-NEXT: 4 .foo.2 00000004
-# NO1-NEXT: 5 .foo.1 00000004
+# NO1: .writable 00000004
+# NO1: .readable 00000004
+# NO1: .foo.2 00000004
+# NO1: .foo.1 00000004
.global _start
_start:
# RUN: *(.eh_frame_hdr) \
# RUN: __eh_frame_hdr_end = .; \
# RUN: __eh_frame_hdr_end2 = ABSOLUTE(ALIGN(0x10)); } \
+# RUN: .eh_frame : { } \
# RUN: }" > %t.script
# RUN: ld.lld -o %t1 --eh-frame-hdr --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=SIMPLE %s