@@ -710,13 +710,13 @@ template <class ELFT> void Writer<ELFT>::addSectionSymbols() {
710
710
auto *osd = dyn_cast<OutputDesc>(cmd);
711
711
if (!osd)
712
712
continue ;
713
- OutputSection *sec = & osd->osec ;
714
- auto i = llvm::find_if (sec-> commands , [](SectionCommand *cmd) {
713
+ OutputSection &osec = osd->osec ;
714
+ auto i = llvm::find_if (osec. commands , [](SectionCommand *cmd) {
715
715
if (auto *isd = dyn_cast<InputSectionDescription>(cmd))
716
716
return !isd->sections .empty ();
717
717
return false ;
718
718
});
719
- if (i == sec-> commands .end ())
719
+ if (i == osec. commands .end ())
720
720
continue ;
721
721
InputSectionBase *isec = cast<InputSectionDescription>(*i)->sections [0 ];
722
722
@@ -733,9 +733,9 @@ template <class ELFT> void Writer<ELFT>::addSectionSymbols() {
733
733
// Set the symbol to be relative to the output section so that its st_value
734
734
// equals the output section address. Note, there may be a gap between the
735
735
// start of the output section and isec.
736
- in.symTab ->addSymbol (
737
- makeDefined (isec-> file , " " , STB_LOCAL, /* stOther= */ 0 , STT_SECTION,
738
- /* value=*/ 0 , /* size=*/ 0 , isec-> getOutputSection () ));
736
+ in.symTab ->addSymbol (makeDefined (isec-> file , " " , STB_LOCAL, /* stOther= */ 0 ,
737
+ STT_SECTION,
738
+ /* value=*/ 0 , /* size=*/ 0 , &osec ));
739
739
}
740
740
}
741
741
0 commit comments