[Nasm-bugs] [Bug 3392533] Considerations for segment support in ELF

noreply-nasm at gorcunov.org noreply-nasm at gorcunov.org
Sat Jul 27 13:00:47 PDT 2019


https://bugzilla.nasm.us/show_bug.cgi?id=3392533

--- Comment #48 from TK Chia <u1049321969 at caramail.com> ---
Hello hpa,

> I did a quick hack to implement R_386_SEGRELATIVE in binutils. This allows
> linking with "-pie -z max-page-size=16" to produce the necessary relocation
> information without all the noise generated by "-q" that needs to be
> filtered out. The dynamic section currently needs to be marked LOAD or ld
> will complain fairly loudly; I'm considering removing that warning since it
> is (IMO) fundamentally wrong if the linker script *explicitly* wants the
> PT_DYNAMIC ELF segment to live outside any PT_LOAD segment; this doesn't
> prevent it from being allocated address space (which is necessary because of
> the way the dynamic section is designed.)

Thank you for this experiment.  (I think a loadable PT_DYNAMIC segment or
SHT_DYNAMIC section should not be too hard to deal with: either objcopy (or a
custom elf2exe tool) can be used to remove it when converting to non-ELF, or
the ELF output will be used at runtime, where it will actually need to be
loadable.)

-- 
You are receiving this mail because:
You are watching all bug changes.
You are on the CC list for the bug.


More information about the Nasm-bugs mailing list