aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Target/ThreadPlanPython.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-10-30 17:03:04 -0700
committerGitHub <noreply@github.com>2023-10-30 17:03:04 -0700
commit5908559c1091245989672ca486c6b3c0a8f60b5a (patch)
treeac215c38de1284ed9f795a4a36ff4148946cc92e /lldb/source/Target/ThreadPlanPython.cpp
parent4b3cd379cce3f455bf3c8677ca7a5be6e708a4ce (diff)
downloadllvm-5908559c1091245989672ca486c6b3c0a8f60b5a.zip
llvm-5908559c1091245989672ca486c6b3c0a8f60b5a.tar.gz
llvm-5908559c1091245989672ca486c6b3c0a8f60b5a.tar.bz2
[X86] Don't set SHF_X86_64_LARGE for variables with explicit section name of a well-known small data section prefix (#70748)
Commit f3ea73133f91c1c23596d45680c8f2269c1dd289 allows SHF_X86_64_LARGE for all global variables with an explicit section. For the following variables, their data sections will be annotated as SHF_X86_64_LARGE. ``` const char relro[512] __attribute__((section(".rodata"))) = "a"; const char *const relro __attribute__((section(".data.rel.ro"))) = "a"; char data[512] __attribute__((section(".data"))) = "a"; ``` The typical linker requirement is that we do not create more than one output section with the same name, and the only output section should have the bitwise OR value of all input section flags. Therefore, the output .data section will have the SHF_X86_64_LARGE flag and be moved away from the regular sections. This is undesired but benign. However, .data.rel.ro having the SHF_X86_64_LARGE flag is problematic because dynamic loaders do not support more than one PT_GNU_RELRO program header, and LLD produces the error `error: section: .jcr is not contiguous with other relro sections`. I believe the most appropriate solution is to disallow SHF_X86_64_LARGE on variables with an explicit section of certain prefixes ( .bss/.data/.bss) and allow others (e.g. metadata sections for various instrumentation). Fortunately, global variables with an explicit .bss/.data/.bss section are rare, so they should not cause excessive relocation overflow pressure.
Diffstat (limited to 'lldb/source/Target/ThreadPlanPython.cpp')
0 files changed, 0 insertions, 0 deletions