This essentially drops the change by r288021 (discussed with Georgii Rymar and Peter Smith and noted down in the release note of lld 10). GNU ld>=2.31 enables -z separate-code by default for Linux x86. By default (in the absence of a PHDRS command) a readonly PT_LOAD is created, which is different from its traditional behavior. Not emulating GNU ld's traditional behavior is good for us because it improves code consistency (we create a readonly PT_LOAD in the absence of a SECTIONS command). Users can add --no-rosegment to restore the previous behavior (combined readonly and read-executable sections in a single RX PT_LOAD).
22 lines
480 B
ArmAsm
22 lines
480 B
ArmAsm
# REQUIRES: x86
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
|
|
|
# RUN: echo "SECTIONS { \
|
|
# RUN: . = SIZEOF_HEADERS; \
|
|
# RUN: .rodata : { *(.aaa) *(.bbb) A = .; *(.ccc) B = .; } \
|
|
# RUN: }" > %t.script
|
|
# RUN: ld.lld -o %t.so --script %t.script %t.o -shared
|
|
# RUN: llvm-nm -D %t.so | FileCheck %s
|
|
|
|
# CHECK: 000000000000025e R A
|
|
# CHECK: 000000000000025f R B
|
|
|
|
.section .aaa,"a"
|
|
.byte 11
|
|
|
|
.section .bbb,"aMS",@progbits,1
|
|
.asciz "foo"
|
|
|
|
.section .ccc,"a"
|
|
.byte 33
|