@@ -55,7 +55,6 @@ template <class ELFT> class Writer {
55
55
private:
56
56
void copyLocalSymbols ();
57
57
void addSectionSymbols ();
58
- void forEachRelSec (llvm::function_ref<void (InputSectionBase &)> fn);
59
58
void sortSections ();
60
59
void resolveShfLinkOrder ();
61
60
void finalizeAddressDependentContent ();
@@ -1031,26 +1030,6 @@ template <class ELFT> void Writer<ELFT>::addRelIpltSymbols() {
1031
1030
Out::elfHeader, 0 , STV_HIDDEN);
1032
1031
}
1033
1032
1034
- template <class ELFT >
1035
- void Writer<ELFT>::forEachRelSec(
1036
- llvm::function_ref<void (InputSectionBase &)> fn) {
1037
- // Scan all relocations. Each relocation goes through a series
1038
- // of tests to determine if it needs special treatment, such as
1039
- // creating GOT, PLT, copy relocations, etc.
1040
- // Note that relocations for non-alloc sections are directly
1041
- // processed by InputSection::relocateNonAlloc.
1042
- for (InputSectionBase *isec : inputSections)
1043
- if (isec->isLive () && isa<InputSection>(isec) && (isec->flags & SHF_ALLOC))
1044
- fn (*isec);
1045
- for (Partition &part : partitions) {
1046
- for (EhInputSection *es : part.ehFrame ->sections )
1047
- fn (*es);
1048
- if (part.armExidx && part.armExidx ->isLive ())
1049
- for (InputSection *ex : part.armExidx ->exidxSections )
1050
- fn (*ex);
1051
- }
1052
- }
1053
-
1054
1033
// This function generates assignments for predefined symbols (e.g. _end or
1055
1034
// _etext) and inserts them into the commands sequence to be processed at the
1056
1035
// appropriate time. This ensures that the value is going to be correct by the
@@ -1928,7 +1907,21 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
1928
1907
// a linker-script-defined symbol is absolute.
1929
1908
ppc64noTocRelax.clear ();
1930
1909
if (!config->relocatable ) {
1931
- forEachRelSec (scanRelocations<ELFT>);
1910
+ // Scan all relocations. Each relocation goes through a series of tests to
1911
+ // determine if it needs special treatment, such as creating GOT, PLT,
1912
+ // copy relocations, etc. Note that relocations for non-alloc sections are
1913
+ // directly processed by InputSection::relocateNonAlloc.
1914
+ for (InputSectionBase *sec : inputSections)
1915
+ if (sec->isLive () && isa<InputSection>(sec) && (sec->flags & SHF_ALLOC))
1916
+ scanRelocations<ELFT>(*sec);
1917
+ for (Partition &part : partitions) {
1918
+ for (EhInputSection *sec : part.ehFrame ->sections )
1919
+ scanRelocations<ELFT>(*sec);
1920
+ if (part.armExidx && part.armExidx ->isLive ())
1921
+ for (InputSection *sec : part.armExidx ->exidxSections )
1922
+ scanRelocations<ELFT>(*sec);
1923
+ }
1924
+
1932
1925
reportUndefinedSymbols<ELFT>();
1933
1926
postScanRelocations ();
1934
1927
}
0 commit comments