HomePhabricator

[MC][ELF] Make linked-to symbol name part of ELFSectionKey
Audit Required0fbe2215438b

Authored by MaskRay on Feb 4 2020, 1:52 PM.

Description

[MC][ELF] Make linked-to symbol name part of ELFSectionKey

https://bugs.llvm.org/show_bug.cgi?id=44775

This rule has been implemented by GNU as https://sourceware.org/ml/binutils/2020-02/msg00028.html (binutils >= 2.35)

It allows us to simplify

.section .foo,"o",foo,unique,0
.section .foo,"o",bar,unique,1  # different section

to

.section .foo,"o",foo
.section .foo,"o",bar  # different section

We consider the two .foo different even if the linked-to symbols foo and bar
are defined in the same section. This is a deliberate choice so that we don't
need to know the section where foo and bar are defined beforehand.

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