mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 11:39:35 +00:00
Continue early to reduce indentation.
llvm-svn: 250096
This commit is contained in:
parent
126d08f891
commit
bb3c33609b
@ -35,30 +35,31 @@ void InputSection<ELFT>::relocate(
|
||||
for (const RelType &RI : Rels) {
|
||||
uint32_t SymIndex = RI.getSymbol(IsMips64EL);
|
||||
uint32_t Type = RI.getType(IsMips64EL);
|
||||
uintX_t SymVA;
|
||||
|
||||
// Handle relocations for local symbols -- they never get
|
||||
// resolved so we don't allocate a SymbolBody.
|
||||
const Elf_Shdr *SymTab = File.getSymbolTable();
|
||||
if (SymIndex < SymTab->sh_info) {
|
||||
SymVA = getLocalRelTarget(File, RI);
|
||||
} else {
|
||||
SymbolBody &Body = *File.getSymbolBody(SymIndex)->repl();
|
||||
SymVA = getSymVA<ELFT>(Body);
|
||||
if (Target->relocNeedsPlt(Type, Body)) {
|
||||
SymVA = Out<ELFT>::Plt->getEntryAddr(Body);
|
||||
Type = Target->getPCRelReloc();
|
||||
} else if (Target->relocNeedsGot(Type, Body)) {
|
||||
SymVA = Out<ELFT>::Got->getEntryAddr(Body);
|
||||
Type = Target->getGotRefReloc();
|
||||
} else if (Target->relocPointsToGot(Type)) {
|
||||
SymVA = Out<ELFT>::Got->getVA();
|
||||
Type = Target->getPCRelReloc();
|
||||
} else if (isa<SharedSymbol<ELFT>>(Body)) {
|
||||
continue;
|
||||
}
|
||||
uintX_t SymVA = getLocalRelTarget(File, RI);
|
||||
Target->relocateOne(Buf, reinterpret_cast<const void *>(&RI), Type,
|
||||
BaseAddr, SymVA);
|
||||
continue;
|
||||
}
|
||||
|
||||
SymbolBody &Body = *File.getSymbolBody(SymIndex)->repl();
|
||||
uintX_t SymVA = getSymVA<ELFT>(Body);
|
||||
if (Target->relocNeedsPlt(Type, Body)) {
|
||||
SymVA = Out<ELFT>::Plt->getEntryAddr(Body);
|
||||
Type = Target->getPCRelReloc();
|
||||
} else if (Target->relocNeedsGot(Type, Body)) {
|
||||
SymVA = Out<ELFT>::Got->getEntryAddr(Body);
|
||||
Type = Target->getGotRefReloc();
|
||||
} else if (Target->relocPointsToGot(Type)) {
|
||||
SymVA = Out<ELFT>::Got->getVA();
|
||||
Type = Target->getPCRelReloc();
|
||||
} else if (isa<SharedSymbol<ELFT>>(Body)) {
|
||||
continue;
|
||||
}
|
||||
Target->relocateOne(Buf, reinterpret_cast<const void *>(&RI), Type,
|
||||
BaseAddr, SymVA);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user