33 lines
1.3 KiB
Text
33 lines
1.3 KiB
Text
Index: lld/ELF/LinkerScript.cpp
|
|
--- lld/ELF/LinkerScript.cpp.orig
|
|
+++ lld/ELF/LinkerScript.cpp
|
|
@@ -103,7 +103,8 @@ static StringRef getOutputSectionName(const InputSecti
|
|
for (StringRef v :
|
|
{".data.rel.ro", ".data", ".rodata", ".bss.rel.ro", ".bss", ".ldata",
|
|
".lrodata", ".lbss", ".gcc_except_table", ".init_array", ".fini_array",
|
|
- ".tbss", ".tdata", ".ARM.exidx", ".ARM.extab", ".ctors", ".dtors"})
|
|
+ ".tbss", ".tdata", ".ARM.exidx", ".ARM.extab", ".ctors", ".dtors",
|
|
+ ".openbsd.randomdata", ".openbsd.mutable"})
|
|
if (isSectionPrefix(v, s->name))
|
|
return v;
|
|
|
|
@@ -998,6 +999,10 @@ void LinkerScript::assignOffsets(OutputSection *sec) {
|
|
sec->name);
|
|
}
|
|
|
|
+ // This section was previously a call to switchTo(), but switchTo()
|
|
+ // was unrolled here.
|
|
+ // On OpenBSD, we had consistently moved the call to switchTo()
|
|
+ // below the next section.
|
|
state->outSec = sec;
|
|
if (sec->addrExpr && script->hasSectionsCommand) {
|
|
// The alignment is ignored.
|
|
@@ -1027,6 +1032,8 @@ void LinkerScript::assignOffsets(OutputSection *sec) {
|
|
} else if (!sameMemRegion || !prevLMARegionIsDefault) {
|
|
state->lmaOffset = 0;
|
|
}
|
|
+
|
|
+ // On OpenBSD, the switchTo() call was here.
|
|
|
|
// Propagate state->lmaOffset to the first "non-header" section.
|
|
if (PhdrEntry *l = sec->ptLoad)
|