Skip to content

Commit 488fb55

Browse files
committed
elf2rel: Fix R_PPC_NONE relocations causing unresolved external symbols
1 parent c02ba1c commit 488fb55

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ttyd-tools/elf2rel/elf2rel.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ int main(int argc, char **argv)
281281
ELFIO::Elf_Sxword addend;
282282
relocations.get_entry(i, offset, symbol, type, addend);
283283

284+
// Ignore R_PPC_NONE
285+
if (type == R_PPC_NONE)
286+
continue;
287+
284288
ELFIO::Elf_Xword size;
285289
unsigned char bind;
286290
unsigned char symbolType;
@@ -382,11 +386,7 @@ int main(int argc, char **argv)
382386
{
383387
Relocation nextRel = allRelocations.front();
384388
allRelocations.pop_front();
385-
386-
// Ignore R_PPC_NONE
387-
if (nextRel.type == R_PPC_NONE)
388-
continue;
389-
389+
390390
// Change module if necessary
391391
if (currentModuleID != nextRel.moduleID)
392392
{

0 commit comments

Comments
 (0)