llvm.org GIT mirror llvm / 7639f98
MCJIT: relocation addends encoded in the target aren't quite so easy. The assumption that the target address for the relocation will always be sizeof(intptr_t) and will always contain an addend for the relocation value is very wrong. Default to no addend for now. rdar://12157052 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163765 91177308-0d34-0410-b5e6-96231b3b80d8 Jim Grosbach 7 years ago
1 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
245245 }
246246 assert(si != se && "No section containing relocation!");
247247 Value.SectionID = findOrEmitSection(Obj, *si, true, ObjSectionToID);
248 Value.Addend = *(const intptr_t *)Target;
248 Value.Addend = 0;
249 // FIXME: The size and type of the relocation determines if we can
250 // encode an Addend in the target location itself, and if so, how many
251 // bytes we should read in order to get it. We don't yet support doing
252 // that, and just assuming it's sizeof(intptr_t) is blatantly wrong.
253 //Value.Addend = *(const intptr_t *)Target;
249254 if (Value.Addend) {
250255 // The MachO addend is an offset from the current section. We need it
251256 // to be an offset from the destination section