[all-commits] [llvm/llvm-project] 1477ed: [MC] Support SHF_GNU_RETAIN as section flag 'R'

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Feb 2 09:34:31 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1477ed846508dc84610b7ca9570e590eb7e21797
      https://github.com/llvm/llvm-project/commit/1477ed846508dc84610b7ca9570e590eb7e21797
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-02-02 (Tue, 02 Feb 2021)

  Changed paths:
    M llvm/lib/MC/MCParser/ELFAsmParser.cpp
    M llvm/lib/MC/MCSectionELF.cpp
    A llvm/test/MC/ELF/section-gnu.s

  Log Message:
  -----------
  [MC] Support SHF_GNU_RETAIN as section flag 'R'

On Linux target triples, GNU as sets EI_OSABI to ELFOSABI_GNU when SHF_GNU_RETAIN is used。
On `*-*-freebsd`, it usually sets EI_OSABI to ELFOSABI_FREEBSD.

GNU ld respects SHF_GNU_RETAIN only for ELFOSABI_FREEBSD/ELFOSABI_GNU.
https://sourceware.org/bugzilla/show_bug.cgi?id=27282

MC doesn't set ELFOSABI_GNU for SHF_GNU_RETAIN/STB_GNU_UNIQUE/STT_GNU_IFUNC.
MC assembled object files do not have special semantics in GNU ld.

Reviewed By: psmith

Differential Revision: https://reviews.llvm.org/D95730




More information about the All-commits mailing list