Revert r337638, "ELF: Make sections with KeepUnique bit eligible for ICF."
authorPeter Collingbourne <peter@pcc.me.uk>
Mon, 23 Jul 2018 19:36:55 +0000 (19:36 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Mon, 23 Jul 2018 19:36:55 +0000 (19:36 +0000)
commit00dc23f26e174842173c288e50732e6ed4491a31
tree974baccbbcdcc8e86f7756e692c71f7556cf3458
parent67af95bbe7285aecc2a96cf8c6d5b108b2a24054
Revert r337638, "ELF: Make sections with KeepUnique bit eligible for ICF."

The gold behaviour with regard to --keep-unique is arguably a bug.
I also noticed a bug in my patch, which is that we mislink the
following program with --icf=safe by merging f3 and f4:

void f1() {}
void f2() {}

__attribute__((weak)) void* f3() { return f1; }
__attribute__((weak)) void* f4() { return f2; }

int main() {
  printf("%p %p\n", f3(), f4());
}

llvm-svn: 337729
lld/ELF/ICF.cpp
lld/test/ELF/icf-keep-unique.s