OSDN Git Service

[ELF] --icf: do not fold preemptible symbols
authorFangrui Song <maskray@google.com>
Sat, 30 Nov 2019 05:58:36 +0000 (21:58 -0800)
committerFangrui Song <maskray@google.com>
Tue, 10 Dec 2019 17:06:08 +0000 (09:06 -0800)
commitcd0ab2428ffedae88457c6286b2c2201e2d1cd1c
tree47a050e7e3cb791e3e5d00e03b1bd3c06d3146b4
parent60ce444eaa146bc2f762c70d433d4a0c847508f0
[ELF] --icf: do not fold preemptible symbols

Fixes PR44124.

A preemptible symbol may refer to a different definition at runtime.
When comparing a pair of relocations, if they refer to different
symbols, and either symbol is preemptible, the two containing sections
should be considered different.

gold has a similar rule https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=ce97fa81e0c46d216b80b143ad8c02fff6906fef

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D71163
lld/ELF/Driver.cpp
lld/ELF/ICF.cpp
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h
lld/ELF/Writer.cpp
lld/test/ELF/icf-preemptible.s [new file with mode: 0644]