[PATCH] D94475: [MC] Emit ELF files with ELFOSABI_GNU if specified in triple

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 10:06:01 PST 2021


MaskRay added a comment.

In D94475#2493513 <https://reviews.llvm.org/D94475#2493513>, @jrtc27 wrote:

> Looking at the original motivation for the patch I'm not convinced that llvm-readelf etc shouldn't just fall back on displaying the "normal" set of GNU extensions even for ELFOSABI_NONE (i.e. those that FreeBSD and GNU have in common). Things like that are really just part of de-facto generic ELF these days. What does binutils do?

For SHF_GNU_RETAIN (new, not in MC), SHT_GNU_IFUNC (useful), SHF_GNU_MBIND (looks like legacy), STB_GNU_UNIQUE, `has_gnu_osabi` bit is set and emit ELFOSABI_GNU instead of ELFOSABI_NONE for Linux triples. I think FreeBSD uses by ELFOSABI_FREEBSD default and can use such extensions as well. Other triples can use these `*_GNU_*`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94475/new/

https://reviews.llvm.org/D94475



More information about the llvm-commits mailing list