tkchia / gcc-ia16

Fork of Lambertsen & Jenner (& al.)'s IA-16 (Intel 16-bit x86) port of GNU compilers ― added far pointers & more • use https://github.com/tkchia/build-ia16 to build • Ubuntu binaries at https://launchpad.net/%7Etkchia/+archive/ubuntu/build-ia16/ • DJGPP/MS-DOS binaries at https://gitlab.com/tkchia/build-ia16/-/releases • mirror of https://gitlab.com/tkchia/gcc-ia16
GNU General Public License v2.0
173 stars 13 forks source link

Far-calling from NASM source to C results in "error: ELF format does not support segment base references" #60

Open ecm-pushbx opened 4 years ago

ecm-pushbx commented 4 years ago

This is a NASM feature request I submitted, to support calling C functions far with immediate calls from NASM: https://bugzilla.nasm.us/show_bug.cgi?id=3392694

tkchia commented 4 years ago

Hello @ecm-pushbx,

Yes, and sorry for the belated reply.

Well, there is no official support yet for IA-16 segment relocations in the ELF file format, and the actual relocation support I implemented into the gcc-ia16 toolchain is rather hacky.

A while back Mr. Anvin (nasm maintainer) actually proposed a way to represent IA-16 segment:offset addresses, which is more rigorous and flexible than the current default method. But there are a few problems:

I wrote a brief write-up to summarize the situation.

So the situation with segment relocations in ELF object files is kind of messy, and I am not sure what the best way forward is.

Thank you!

(Edited to add: related discussion at a separate Bugzilla thread.)

ecm-pushbx commented 4 years ago

Two of your links lead to the same document.

tkchia commented 4 years ago

(@ecm-pushbx : corrected; thanks!)

roytam1 commented 2 years ago

nasm bugzilla seems down