[mach-o] x86_64 relocation code review fixes

llvm-svn: 212068
This commit is contained in:
Nick Kledzik 2014-06-30 20:44:47 +00:00
parent cdb4e64a20
commit b201cf8883
2 changed files with 5 additions and 5 deletions

View File

@ -405,7 +405,7 @@ std::error_code processSection(DefinedAtom::ContentType atomType,
size = is64 ? 32 : 20;
break;
case atomizeCFString:
// Break section up into compact unwind entries.
// Break section up into NS/CFString objects.
size = is64 ? 32 : 16;
break;
case atomizeAtSymbols:
@ -505,8 +505,7 @@ std::error_code convertRelocs(const Section &section,
MachODefinedAtom *inAtom = file.findAtomCoveringAddress(section,
reloc.offset,
&offsetInAtom);
if (!inAtom)
return make_dynamic_error_code(Twine("no atom at r_address"));
assert(inAtom && "r_address in range, should have found atom");
uint64_t fixupAddress = section.address + reloc.offset;
const lld::Atom *target = nullptr;

View File

@ -135,7 +135,7 @@ const Registry::KindStrings KindHandler_x86_64::kindStrings[] = {
LLD_KIND_STRING_ENTRY(delta64Anon),
LLD_KIND_STRING_END
};
bool KindHandler_x86_64::isCallSite(const Reference &ref) {
if (ref.kindNamespace() != Reference::KindNamespace::mach_o)
return false;
@ -147,7 +147,8 @@ bool KindHandler_x86_64::isPointer(const Reference &ref) {
if (ref.kindNamespace() != Reference::KindNamespace::mach_o)
return false;
assert(ref.kindArch() == Reference::KindArch::x86_64);
return (ref.kindValue() == pointer64);
Reference::KindValue kind = ref.kindValue();
return (kind == pointer64 || kind == pointer64Anon);
}
bool KindHandler_x86_64::isLazyImmediate(const Reference &ref) {