the linker should be taught to emit a new header type which would store the bitmap. It would be near the beginning of the ELF file, eliminating the seek. A problem with that approach is that old binaries would not be able to take advantage of the technique; a re-linking would be required.
PT_GNU_STACK currently uses only .p_flags, and the default linker script has inserted PT_GNU_STACK for a couple years. So re-linking could be avoided in nearly all cases. Just set .p_offset to ALIGN_UP(old_file_size, 4), etc.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds