[PATCH] D80049: [lld-macho] Add some relocation validation logic

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 16:52:24 PDT 2020


int3 created this revision.
int3 added reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
int3 edited the summary of this revision.

I considered making a `Target::validate()` method, but I wasn't sure how I felt about the overhead of doing yet another switch-dispatch on the relocation type, so I put the validation in `relocateOne` instead... might be a bit of a micro-optimization, but `relocateOne` does assume certain things about the relocations it gets, and this error handling makes that explicit, so it's not a totally unreasonable code organization.

Depends on D80048 <https://reviews.llvm.org/D80048>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80049

Files:
  lld/MachO/Arch/X86_64.cpp
  lld/MachO/InputSection.cpp
  lld/MachO/Target.h
  lld/test/MachO/invalid/invalid-relocation.yaml

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80049.264388.patch
Type: text/x-patch
Size: 6745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200515/c64d27ae/attachment-0001.bin>


More information about the llvm-commits mailing list