There could be multiple discontiguous output .note sections in which case we need to put these into separate PT_NOTE segments rather then placing them into a single segment. Where possible, we could reorder the input sections to make sure that all .note are layed out next to each other to avoid creation multiple PT_NOTE segments, but even in that case, it's still possible to construct a discontiguous case e.g. by using a linker script.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
ELF/Writer.cpp | ||
---|---|---|
1236–1240 | Can you move this code out of this for loop and create a new loop only for .notes? I think doing that improves readability. |
Comment Actions
I think this also needs testcase which shows that next case still creates single PT_NOTE segment:
.note : { *(.note.a) *(.note.b) }
Comment Actions
LGTM
Please add a comment saying that that code creates one PT_NOTE per a group of contiguous .note sections.
Can you move this code out of this for loop and create a new loop only for .notes? I think doing that improves readability.