[ELF] -Map: Print symbols which needs canonical PLT entry/copy relocation just once
authorFangrui Song <i@maskray.me>
Tue, 14 Dec 2021 18:31:06 +0000 (10:31 -0800)
committerFangrui Song <i@maskray.me>
Tue, 14 Dec 2021 18:31:06 +0000 (10:31 -0800)
commit6a44013b0e319979ce6ea9ead2a740564e434f76
treeae9df34bed224c134ec3a328d96f44f01ddbd7e7
parente0aa2ea661fbdd6443a0aa36803ca34152e32a52
[ELF] -Map: Print symbols which needs canonical PLT entry/copy relocation just once

If a copy related symbol (say `copy`) is referenced in two .o
files, this change removes a duplicated line from the -Map output:

```
          202470           202470        1     1 .bss.rel.ro
          202470           202470        1     1         <internal>:(.bss.rel.ro)
          202470           202470        1     1                 copy
removed   202470           202470        1     1                 copy
```

Differential Revision: https://reviews.llvm.org/D115697
lld/ELF/MapFile.cpp
lld/test/ELF/map-file-copy.s [new file with mode: 0644]