diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2016-01-06 20:53:19 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2016-01-06 20:53:19 +0000 |
| commit | d53090ac5e4382f1aaad8ddeff0fce4b43824bad (patch) | |
| tree | 34faa1b36615f0fdb017e5e317c35c85c5647611 /lld/lib/ReaderWriter/MachO | |
| parent | c2d6461a4afb3701e7eb4991b3143751b802cd9f (diff) | |
| download | bcm5719-llvm-d53090ac5e4382f1aaad8ddeff0fce4b43824bad.tar.gz bcm5719-llvm-d53090ac5e4382f1aaad8ddeff0fce4b43824bad.zip | |
Fix MachO arm64 delta32ToGOT reloc encoding in -r.
The fixup content we encode here should be the offset from the
fixup location back to the last nonlocal label. We were only encoding
the address of the fixup, and not taking in to account the base address
of the atom we are in.
Updated the test case here to have a text section which will come before
the data section where the relocation lives. .data being at offset 0 had
previously been hiding this bug.
llvm-svn: 256974
Diffstat (limited to 'lld/lib/ReaderWriter/MachO')
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp b/lld/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp index 0ba590cc642..3f69cfa2547 100644 --- a/lld/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp +++ b/lld/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp @@ -697,7 +697,7 @@ void ArchHandler_arm64::applyFixupRelocatable(const Reference &ref, *loc64 = 0; return; case delta32ToGOT: - *loc32 = -fixupAddress; + *loc32 = inAtomAddress - fixupAddress; return; case addOffset12: llvm_unreachable("lazy reference kind implies GOT pass was run"); |

