[all-commits] [llvm/llvm-project] 967002: [ELF] Keep st_type for symbol assignment

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Aug 20 16:06:02 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9670029b6b302c75bb373fb1814f4e02790c4da8
      https://github.com/llvm/llvm-project/commit/9670029b6b302c75bb373fb1814f4e02790c4da8
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-08-20 (Thu, 20 Aug 2020)

  Changed paths:
    M lld/ELF/LinkerScript.cpp
    M lld/ELF/LinkerScript.h
    M lld/docs/ELF/linker_script.rst
    M lld/test/ELF/arm-thumb-interwork-ifunc.s
    M lld/test/ELF/linkerscript/common-assign.s
    A lld/test/ELF/linkerscript/symbol-assign-type.s

  Log Message:
  -----------
  [ELF] Keep st_type for symbol assignment

PR46970: for `alias = aliasee`, the alias can be used in relocation processing
and on ARM st_type does affect Thumb interworking. It is thus desirable for the
alias to get the same st_type.

Note that the st_size field should not be inherited because some tools use
st_size=0 as a heuristic to detect aliases. Retaining st_size can thwart such
heuristics and cause aliases to be preferred over the original symbols.

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




More information about the All-commits mailing list