Page MenuHomePhabricator

[LLD][ELF] Add support for OpenBSD PT_OPENBSD_MUTABLE segment type
Needs ReviewPublic

Authored by brad on Nov 13 2022, 5:00 PM.



Add support to the linker for 'PT_OPENBSD_MUTABLE' segment type.

Diff Detail

Event Timeline

brad created this revision.Nov 13 2022, 5:00 PM
brad requested review of this revision.Nov 13 2022, 5:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 13 2022, 5:00 PM

This needs a test. You may merge it with openbsd-randomize.s and possibly rename the test file.
The OpenBSD section/program header types are settled? I think the kernel has no usage yet.
Hope that David's comments in are useful ;-)

brad updated this revision to Diff 476658.Nov 18 2022, 9:41 PM
MaskRay added inline comments.Nov 19 2022, 9:09 AM

This can be shared with openbsd-randomdata


ditto. llvm-readelf -l is preferred for new tests.

It seems that OpenBSD is adding more and more OS specific program headers. The pace is kinda fast.
It's true that GNU is adding a lot program headers as well but many have gain support from many other OSes....
I think we can wait a bit before committing to add this permanent thing..

If one wants to play with PT_OPENBSD_MUTABLE, in a PHDRS command, a program header can have a numeric type (