[PATCH] D41057: Avoid a gnu readelf warning

Ed Maste via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 17:31:09 PST 2017


emaste added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:1233
+  if (this == InX::RelaPlt) {
+    Info = InX::GotPlt->getParent()->SectionIndex;
+    getParent()->Info = Info;
----------------
ruiu wrote:
> grimar wrote:
> > emaste wrote:
> > > Why `.got.plt` and not `.plt`?
> > 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 ?
> I think I feel the same as George. Is this an issue?
> 
> Can you always set or always not set `Info`?
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
```




https://reviews.llvm.org/D41057





More information about the llvm-commits mailing list