[Nasm-bugs] [Bug 3392533] Considerations for segment support in ELF
noreply-nasm at gorcunov.org
noreply-nasm at gorcunov.org
Tue Dec 4 02:41:57 PST 2018
https://bugzilla.nasm.us/show_bug.cgi?id=3392533
--- Comment #10 from stsp at list.ru ---
Here's what ia16-gcc author writes:
---
I added some "ELF" relocation types to binutils-ia16 to specifically support
MZ relocations, so that under ia16-elf-as you can write, say,
.hword foo
.reloc ., R_386_SEGMENT16, foo
.hword 0
to emit a far pointer to a foo symbol. (And indeed this is similar to what
ia16-elf-gcc does to emit pointers to far variables.)
If you wish to stick with nasm, one possible way would be to manually populate
the .msdos_mz_reloc segment with the actual MZ relocation entries --- you can
do this --- though naturally this will not be very neat. Alas, nasm most
probably does not know about the special relocation types.
---
So the needed elf extensions seems to be already here!
I think they are currently only available in ia16-elf-ld,
but will be available in a regular ld in the future.
I'll invite its author to this thread for a clarification.
While I already wrote a manual relocation framework that
uses objdump+grep to look up segments, I'll be happy to
scrap it. It enlarges the compilation time a lot, and overall
is a gross hack.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.
More information about the Nasm-bugs
mailing list