diff options
author | Igor Kudrin <ikudrin@accesssoftek.com> | 2024-12-05 09:55:59 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-04 18:55:59 -0800 |
commit | 740ac4f0ffbab304e3f74ce8d1d0505479d0f800 (patch) | |
tree | 14f164148de1bb0dcb0fff22048376c8faa5dbb8 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 00d8ea3a4c8eba9aa0f14c352192e94cc40f8e2d (diff) | |
download | llvm-740ac4f0ffbab304e3f74ce8d1d0505479d0f800.zip llvm-740ac4f0ffbab304e3f74ce8d1d0505479d0f800.tar.gz llvm-740ac4f0ffbab304e3f74ce8d1d0505479d0f800.tar.bz2 |
Reland "[ObjectYAML][ELF] Take alignment into account when generating notes" (#118434)
This relands #118157 with a fix for the use of an uninitialized
variable and additional tests.
The System V ABI
(https://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section)
states that the note entries and their descriptor fields must be aligned
to 4 or 8 bytes for 32-bit or 64-bit objects respectively. In practice,
64-bit systems can use both alignments, with the actual format being
determined by the alignment of the segment. For example, the Linux
gABI extension (https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf)
contains a special note on this, see 2.1.7 "Alignment of Note Sections".
This patch adjusts the format of the generated notes to the specified
section alignment. Since `llvm-readobj` was fixed in a similar way in
https://reviews.llvm.org/D150022, "[Object] Fix handling of Elf_Nhdr
with sh_addralign=8", the generated notes can now be parsed
successfully by the tool.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions