[PATCH] D43241: [ELF] - Do not crash with --emit-relocs and --icf=all together.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 10:51:05 PST 2018


An interesting case that might clarify where this code should be is what
ICF should do about SHF_LINK_ORDER.

What happens if a section has SHF_LINK_ORDER and another otherwise
identical one doesn't?

Should ICF avoid merging the sections? Should it merge and keep the
SHF_LINK_ORDER linked section?

Cheers,
Rafael

Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:

> ruiu added a comment.
>
> `replace` is not designed to be smart, and adding new code there seems semantically incorrect, as replacing some section doesn't necessarily mean that its dependent sections should be marked as dead.
>
> You could instead add code to ICF.cpp.
>
>
> https://reviews.llvm.org/D43241


More information about the llvm-commits mailing list