Author Topic: Proposed change: ELFOSABI_NONE instead of ELFOSABI_LINUX  (Read 734 times)

lucho

  • Regular Member
  • *
  • Posts: 14
Proposed change: ELFOSABI_NONE instead of ELFOSABI_LINUX
« on: July 05, 2022, 04:22:22 AM »
Hello! I built UASM 2.55 for Solaris the same way as for MacOS and FreeBSD (see my previous post). But it turned out that the Solaris linker doesn't like the ELFOSABI_LINUX value that UASM 2.55 was putting into the "modinfo->elf_osabi" field, when it was trying to link the ELF files generated by UASM. So I changed this line (the first one of the body of the "elf_init()" function in the "elf.c" file) to

modinfo->elf_osabi = ELFOSABI_NONE;

Then the Solaris linker started to successfully link the ELF object files generated by the so modified UASM 2.55, and the FreeBSD and Linux linkers also link them, like they did before. So I propose this change to allow using ELF object this generated by UASM not only in Linux, but also in other Unix-like operating systems. In fact, the ELFOSABI_NONE value is the same as ELFOSABI_SYSV designating the standard Unix world ABI.

johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
Re: Proposed change: ELFOSABI_NONE instead of ELFOSABI_LINUX
« Reply #1 on: July 08, 2022, 06:23:07 PM »
This is a reasonable suggestion. Could you log it on the github repo issues list and I can make this change for 2.56 ?
Thanks!

lucho

  • Regular Member
  • *
  • Posts: 14
Re: Proposed change: ELFOSABI_NONE instead of ELFOSABI_LINUX
« Reply #2 on: July 26, 2022, 06:20:53 PM »
You're welcome! Just did it. Sorry for the big delay!

johnsa

  • Member
  • ****
  • Posts: 893
    • Uasm
Re: Proposed change: ELFOSABI_NONE instead of ELFOSABI_LINUX
« Reply #3 on: October 01, 2022, 11:43:43 PM »
This change is in the 2.56 branch now.