[all-commits] [llvm/llvm-project] 73ca96: [ELF][test] Enhance x86-64-split-stack-prologue-ad...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Aug 11 08:07:53 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 73ca96ebc156daeb56d63981b316b8bf060b0d7f
      https://github.com/llvm/llvm-project/commit/73ca96ebc156daeb56d63981b316b8bf060b0d7f
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-08-11 (Tue, 11 Aug 2020)

  Changed paths:
    M lld/test/ELF/non-abs-reloc.s
    M lld/test/ELF/x86-64-split-stack-prologue-adjust-success.s

  Log Message:
  -----------
  [ELF][test] Enhance x86-64-split-stack-prologue-adjust-success.s & non-abs-reloc.s

Catch problems when outSecOff is not zero and outSecOff is added twice or not added.


  Commit: e973c1375ed04b1d71fa86f1519d5067d8a6fc1f
      https://github.com/llvm/llvm-project/commit/e973c1375ed04b1d71fa86f1519d5067d8a6fc1f
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-08-11 (Tue, 11 Aug 2020)

  Changed paths:
    M lld/ELF/AArch64ErrataFix.cpp
    M lld/ELF/ARMErrataFix.cpp
    M lld/ELF/InputSection.cpp
    M lld/ELF/SyntheticSections.cpp
    M lld/test/ELF/non-abs-reloc.s

  Log Message:
  -----------
  [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate

For an InputSection, the `buf` argument of `InputSectionBase::relocate` points
to the content of the containing OutputSection, instead of the content of the
InputSection itself, so `outSecOff` needs to be added in its callees.  This is
counter-intuitive and leads to many `- outSecOff` and `+ outSecOff`.

This patch makes `InputSection::writeTo` call `InputSectionBase::relocate` with
`outSecOff` added. relocAlloc/relocNonAlloc/relocateNonAllocForRelocatable can
thus be simplified now.

Updated test:

* non-abs-reloc.s: A minor offset bug is fixed for a diagnostic in `relocateNonAlloc`

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D85618


Compare: https://github.com/llvm/llvm-project/compare/dbc468dc3199...e973c1375ed0


More information about the All-commits mailing list