This avoids a readelf warning, matches bfd ld and should be harmless.
Diff Detail
Event Timeline
| ELF/SyntheticSections.cpp | ||
|---|---|---|
| 1233 | Why .got.plt and not .plt? | |
| ELF/SyntheticSections.cpp | ||
|---|---|---|
| 1233 | Do we really want to care about readelf warnings about something that is not in ELF spec (I assume it is not) ? While it is not a error... may be we can just ignore it ? | |
| ELF/SyntheticSections.cpp | ||
|---|---|---|
| 1233 | I think I feel the same as George. Is this an issue? Can you always set or always not set Info? | |
| ELF/SyntheticSections.cpp | ||
|---|---|---|
| 1233 | Ah, I believe I observed (older) ld.bfd storing .plt's section in .rela.plt Info, but testing now with ld.bfd 2.28 I get behaviour as expected from this patch:   [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
...
  [ 9] .rela.plt         RELA             00000000004003b8  000003b8
       0000000000000060  0000000000000018  AI       5    21     8
...
  [21] .got.plt          PROGBITS         00000000006009f0  000009f0
       0000000000000038  0000000000000008  WA       0     0     8 | |
It looks a bit of cargo-cult, and I think I'm not very happy about this change. If it is not too annoying, I wouldn't do this at least right now.
FWIW our standard readelf in FreeBSD comes from the ELF Tool Chain project and doesn't have the warning. It's only when the GNU readelf package is installed that we'd encounter this.
Overall I'm indifferent to this change going in.
Why .got.plt and not .plt?