diff options
author | Fangrui Song <maskray@google.com> | 2020-03-03 15:37:12 -0800 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2020-03-11 09:35:42 -0700 |
commit | fbf41b52677d9e64a888be755b4fdaef89cf519e (patch) | |
tree | 3948d6efc88430495f51ec6e058f680d0657360b /clang/lib/Lex/ModuleMap.cpp | |
parent | 2150a6d0d635dea12c23dc84f356deeacbc8fbc2 (diff) | |
download | llvm-fbf41b52677d9e64a888be755b4fdaef89cf519e.zip llvm-fbf41b52677d9e64a888be755b4fdaef89cf519e.tar.gz llvm-fbf41b52677d9e64a888be755b4fdaef89cf519e.tar.bz2 |
[ELF] Simplify sh_addr computation and warn if sh_addr is not a multiple of sh_addralign
See `docs/ELF/linker_script.rst` for the new computation for sh_addr and sh_addralign.
`ALIGN(section_align)` now means: "increase alignment to section_align"
(like yet another input section requirement).
The "start of section .foo changes from 0x11 to 0x20" warning no longer
makes sense. Change it to warn if sh_addr%sh_addralign!=0.
To decrease the alignment from the default max_input_align,
use `.output ALIGN(8) : {}` instead of `.output : ALIGN(8) {}`
See linkerscript/section-address-align.test as an example.
When both an output section address and ALIGN are set (can be seen as an
"undefined behavior" https://sourceware.org/ml/binutils/2020-03/msg00115.html),
lld may align more than GNU ld, but it makes a linker script working
with GNU ld hard to break with lld.
This patch can be considered as restoring part of the behavior before D74736.
Differential Revision: https://reviews.llvm.org/D75724
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions