Repository navigation
[ELD] Add GNU property support for X86 and RISC-V - #2089
Rachit Mehta (rachitmeht) wants to merge 1 commit into
Conversation
| return false; | ||
| } | ||
| const auto *Nhdr = reinterpret_cast<const Elf_Nhdr *>(Data.data()); | ||
| const uint64_t NoteSize = Nhdr->getSize(S->getAddrAlign()); |
There was a problem hiding this comment.
Can you please check if there is any valid case where S->getAddrAlign might be 0? In ELF, the alignment of 0 typically means alignment of 1, but Nhdr->getSize(0) can result in assertion failure. If this code was the same as in the original AArch64, then can you please leave it as-is for now and open an issue to track this.
There was a problem hiding this comment.
I could not find a normal assembler-only way to generate such a case.
| if (S->getKind() == LinkerSectionKind::GNUProperty) | ||
| return GNULDBackend::readSection(pInput, S); |
There was a problem hiding this comment.
Is this if-condition required? Wouldn't we fallback to the same GNULDBackend::readSection(...) at line 235 without it?
There was a problem hiding this comment.
for .section .note.gnu.property, "ax", @note isCode() will be true, and it will not reach GNULDBackend::readSection(...).
Generalize the existing AArch64 GNU property handling and enable FEATURE_1_AND merging for x86-64, i386, and RISC-V. Emit correctly sized and aligned ELF32 and ELF64 property notes, and add tests for feature merging, missing notes, linker scripts, discarded notes, and malformed inputs. Resolves qualcomm#1680 Signed-off-by: Rachit Mehta <rachmeht@qti.qualcomm.com>
3df02cf to
50f6cb1
Compare
Generalize the existing AArch64 GNU property handling and enable FEATURE_1_AND merging for x86-64, i386, and RISC-V.
Emit correctly sized and aligned ELF32 and ELF64 property notes, and add tests for feature merging, missing notes, linker scripts, discarded notes, and malformed inputs.
Resolves #1680