[PATCH] D62464: [PPC32] Improve 32-bit PowerPC

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 23:47:09 PDT 2019


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:2313
+    // Then write PLTresolve.
+    Target->writePltHeader(Buf + 4 * N);
+    return;
----------------
ruiu wrote:
> MaskRay wrote:
> > ruiu wrote:
> > > Hmm, so we don't call writePlt() if a target is PPC32?
> > On PPC32, how PLT works is different from targets (it is still similar to PPC64). I've added more comments in PPC::writePltHeader.
> So, this is not really a PLT header but a PPC32-specific mechanism. Is writePltHeader a correct name? Maybe we should rename this writePPC32PltResolver or something like that?
`.glink` is indeed a PPC-specific mechanism (PPC64 moves the "footer" (PLTresolve) to the "header" so it looks more conventional).

The `PPC` class is in an unnamed namespace so I cannot access it from SyntheticSections.cpp.  If you still think `writePPC32PltResolver` is the way to go, I can extract it from the class and place it into the `lld::elf::` namespace. I still feel it may not worth the trouble.

```
namespace {
class PPC final : public TargetInfo {
public:
...
  void writePltHeader(uint8_t *Buf) const override;
```


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62464/new/

https://reviews.llvm.org/D62464





More information about the llvm-commits mailing list