summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r--lld/ELF/Writer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 491f4f7bcbe..2d8daad4f7d 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1089,9 +1089,9 @@ template <class ELFT> void Writer<ELFT>::addPredefinedSections() {
template <class ELFT> void Writer<ELFT>::addStartEndSymbols() {
auto Define = [&](StringRef Start, StringRef End, OutputSectionBase *OS) {
// These symbols resolve to the image base if the section does not exist.
+ // A special value -1 indicates end of the section.
addOptionalSynthetic<ELFT>(Start, OS, 0);
- addOptionalSynthetic<ELFT>(End, OS,
- OS ? DefinedSynthetic<ELFT>::SectionEnd : 0);
+ addOptionalSynthetic<ELFT>(End, OS, OS ? -1 : 0);
};
Define("__preinit_array_start", "__preinit_array_end",
@@ -1114,8 +1114,7 @@ void Writer<ELFT>::addStartStopSymbols(OutputSectionBase *Sec) {
if (!isValidCIdentifier(S))
return;
addOptionalSynthetic<ELFT>(Saver.save("__start_" + S), Sec, 0, STV_DEFAULT);
- addOptionalSynthetic<ELFT>(Saver.save("__stop_" + S), Sec,
- DefinedSynthetic<ELFT>::SectionEnd, STV_DEFAULT);
+ addOptionalSynthetic<ELFT>(Saver.save("__stop_" + S), Sec, -1, STV_DEFAULT);
}
template <class ELFT>
OpenPOWER on IntegriCloud