HomePhabricator

[ELF] Keep st_type for symbol assignment
c4e216711d00Unpublished

Authored by MaskRay on Aug 24 2020, 12:17 PM.

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

[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

(cherry picked from commit 9670029b6b302c75bb373fb1814f4e02790c4da8)
The test symbol-assign-type.s was rewritten to not depend on 'split-file'.

Details

Committed
MaskRayAug 24 2020, 12:17 PM
Parents
rGd6d03d09e3f7: [ELF][test] Fix some llvm-objdump RUN lines which don't actually test anything
Branches
Unknown
Tags
Unknown