This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Support aarch64_be
ClosedPublic

Authored by MaskRay on Feb 5 2021, 5:03 PM.

Details

Summary

This patch adds

  • Big-endian values for R_AARCH64_{ABS,PREL}{16,32,64} and R_AARCH64_PLT32
  • aarch64elfb & aarch64linuxb BFD emulations
  • elf64-bigaarch64 output format (bfdname)

Link: https://github.com/ClangBuiltLinux/linux/issues/1288

Diff Detail

Event Timeline

MaskRay created this revision.Feb 5 2021, 5:03 PM
MaskRay requested review of this revision.Feb 5 2021, 5:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2021, 5:03 PM
MaskRay updated this revision to Diff 321955.EditedFeb 6 2021, 11:51 AM
MaskRay edited the summary of this revision. (Show Details)

Tested in an aarch64_be rootfs

ld.lld can link gcc compiled object files and produce working executables and shared objects.

MaskRay updated this revision to Diff 321961.Feb 6 2021, 12:55 PM

Support bitcode file e_machine inference
Test .got.plt

peter.smith accepted this revision.Feb 8 2021, 4:58 AM

Changes LGTM.

I think the PLT32 relocation also needs to be write32 rather than write32le (https://github.com/ARM-software/abi-aa/blob/master/aaelf64/aaelf64.rst#575static-data-relocations) I couldn't immediately spot anything else missing.

lld/ELF/Arch/AArch64.cpp
335

I think PLT32 should be write as it is data (a 32-bit offset).

At the moment it is only used by Fuchsia for relative vtables so I wouldn't expect this to show up in linux.

This revision is now accepted and ready to land.Feb 8 2021, 4:58 AM
MaskRay updated this revision to Diff 322130.Feb 8 2021, 8:54 AM
MaskRay edited the summary of this revision. (Show Details)

Add PLT32

This revision was landed with ongoing or failed builds.Feb 8 2021, 8:55 AM
This revision was automatically updated to reflect the committed changes.