Page MenuHomePhabricator

[ELF][PPC32] Support range extension thunk with addends
ClosedPublic

Authored by MaskRay on Jan 25 2020, 8:54 PM.

Details

Summary
  • Generalize the code added in D70637 and D70937. We should eventually

remove EM_ARM and EM_MIPS special cases.

  • Handle R_PPC_LOCAL24PC the same way as R_PPC_REL24.

Diff Detail

Event Timeline

MaskRay created this revision.Jan 25 2020, 8:54 PM
Herald added a project: Restricted Project. · View Herald Transcript

Unit tests: fail. 62196 tests passed, 1 failed and 815 were skipped.

failed: lld.ELF/ppc32-long-thunk.s

clang-tidy: fail. clang-tidy found 0 errors and 15 warnings. 0 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

MaskRay updated this revision to Diff 240411.Jan 25 2020, 9:09 PM
MaskRay retitled this revision from [ELF][PPC32] Support range extension thunk to [ELF][PPC32] Support range extension thunk with addends.
MaskRay edited the summary of this revision. (Show Details)
MaskRay removed subscribers: wuzish, merge_guards_bot.

Handle R_PPC_LOCAL24PC as well

Unit tests: pass. 62197 tests passed, 0 failed and 815 were skipped.

clang-tidy: fail. clang-tidy found 0 errors and 15 warnings. 0 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

MaskRay updated this revision to Diff 240413.Jan 25 2020, 9:37 PM
MaskRay edited the summary of this revision. (Show Details)

Simplify

Unit tests: pass. 62197 tests passed, 0 failed and 815 were skipped.

clang-tidy: fail. clang-tidy found 0 errors and 15 warnings. 0 of them are added as review comments below (why?).

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

Unit tests: pass. 62197 tests passed, 0 failed and 815 were skipped.

clang-tidy: fail. clang-tidy found 0 errors and 15 warnings. 0 of them are added as review comments below (why?).

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

MaskRay updated this revision to Diff 240414.Jan 25 2020, 10:00 PM

Simplify via getPCBias()

Unit tests: pass. 62197 tests passed, 0 failed and 815 were skipped.

clang-tidy: fail. clang-tidy found 0 errors and 15 warnings. 0 of them are added as review comments below (why?).

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

Bdragon28 accepted this revision.Jan 25 2020, 10:19 PM

This is necessary to run large programs like clang on FreeBSD powerpc32 when built with lld, because of REL24 branches in the crt startup code (done on purpose for object reusability reasons -- the csu objects need to work on both non-pic and pic, so they just use a plain bl and rely on the link editor to do a thunk if necessary.)

Looks good to me from a functionality standpoint on powerpc32.

This revision is now accepted and ready to land.Jan 25 2020, 10:19 PM
This revision was automatically updated to reflect the committed changes.