This behavior matches GNU ld and seems reasonable. ``` // If a SECTIONS command is not specified .text.* -> .text .rodata.* -> .rodata .init_array.* -> .init_array ``` A proposed Linux feature CONFIG_FG_KASLR may depend on the GNU ld behavior. Reword a comment about -z keep-text-section-prefix and a comment about CommonSection (deleted by rL286234). Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D75225
24 lines
885 B
ArmAsm
24 lines
885 B
ArmAsm
# REQUIRES: x86
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
|
# RUN: echo "MEMORY { ram2 (ax) : ORIGIN = 0x1000, LENGTH = 1K \
|
|
# RUN: ram1 (ax) : ORIGIN = 0x4000, LENGTH = 1K } \
|
|
# RUN: SECTIONS {}" > %t1.script
|
|
# RUN: ld.lld -o %t1 --script %t1.script %t
|
|
# RUN: llvm-objdump --section-headers %t1 | FileCheck %s
|
|
|
|
# RUN: echo "MEMORY { ram1 (ax) : ORIGIN = 0x1000, LENGTH = 1K \
|
|
# RUN: ram2 (ax) : ORIGIN = 0x4000, LENGTH = 1K } \
|
|
# RUN: SECTIONS {}" > %t2.script
|
|
# RUN: ld.lld -o %t2 --script %t2.script %t
|
|
# RUN: llvm-objdump --section-headers %t2 | FileCheck %s
|
|
|
|
## Check we place .text into first defined memory region with appropriate flags.
|
|
# CHECK: Sections:
|
|
# CHECK: Idx Name Size VMA
|
|
# CHECK: 0 00000000 0000000000000000
|
|
# CHECK: 1 .text 00000001 0000000000001000
|
|
|
|
.section .text,"ax",%progbits
|
|
foo:
|
|
nop
|