Skip to content

Commit c7231e4

Browse files
committed
[ELF] Use invokeOnRelocs. NFC
1 parent 6efc377 commit c7231e4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lld/ELF/InputSection.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,11 +1073,7 @@ void InputSectionBase::relocate(uint8_t *buf, uint8_t *bufEnd) {
10731073
auto *sec = cast<InputSection>(this);
10741074
// For a relocatable link, also call relocateNonAlloc() to rewrite applicable
10751075
// locations with tombstone values.
1076-
const RelsOrRelas<ELFT> rels = sec->template relsOrRelas<ELFT>();
1077-
if (rels.areRelocsRel())
1078-
sec->relocateNonAlloc<ELFT>(buf, rels.rels);
1079-
else
1080-
sec->relocateNonAlloc<ELFT>(buf, rels.relas);
1076+
invokeOnRelocs(*sec, sec->relocateNonAlloc<ELFT>, buf);
10811077
}
10821078

10831079
// For each function-defining prologue, find any calls to __morestack,

0 commit comments

Comments
 (0)