mirror of
https://github.com/bitwiseworks/gcc-os2.git
synced 2026-02-14 14:15:02 +00:00
Suport ELF as object format #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dmik on GitHub (Jan 16, 2020).
Currently, GCC for OS/2 compiles sources into
a.outobject files. Which are then converted to OMF withemxomf.exeand linked to an OS/2 LX executable (EXE or DLL) usingwlinkfrom OpenWatcom orilinkfrom IBM VisualAge C (not actually suitable for modern C++ and therefore not supported by us, mainly because it's very dead).Such a pipeline has many drawbacks. First, it's very slow as includes a separate step of converting A.OUT to OMF. Second, A.OUT is very old and is not suitable for some applications per se. See #11 for one example. Third, there are lots of limitations on the debug information in both A.OUT and OMF (both are very old).
We need to find a way to link ELF objects to LX executables. Then we will be able to configure GCC so that it will generate ELF on OS/2 and we are done. There are rumors that
wlinkalready supports linking ELF to LX. This needs checking.@dryeo commented on GitHub (Jan 16, 2020):
There is objconv, https://www.agner.org/optimize/#objconv which can
convert elf to omf, obj files and libraries. There is
http://www.os2site.com/sw/dev/gcc/misc/elfomf.zip for which the source
sadly seems to be lost and also XFree86 has an elf loader in the xserver
so we could directly load Linux video modules, needed gcc-elf to build.
Knut might know more about elfomf.
@dmik commented on GitHub (Jan 17, 2020):
@dryeo thanks for the info. OTOH, converting ELF to OMF kinda beats the whole purpose. We will lose all ELF benefits we need. The only way to go here is link ELF directly to LX (or provide an ELF loader to avoid the LX stage at all — this is where Knut's work could be useful I guess).
Anyway, there is no plans to work on that any time soon. Low priority.
@ydario commented on GitHub (Jan 17, 2020):
Also Odin WIN32K.SYS driver is able to load directly ELF executables; unfortunately the driver works with older kernels, it misses alignment required to use newer kernels.