forked from OSchip/llvm-project
[ELF] -r: move zero OutputSection::addr code into finalizeAddressDependentContent
Ensure addresses are unchanged after finalizeAddressDependentContent.
This commit is contained in:
parent
f261e258ec
commit
e590c9bc73
|
@ -557,9 +557,6 @@ template <class ELFT> void Writer<ELFT>::run() {
|
||||||
for (Partition &part : partitions)
|
for (Partition &part : partitions)
|
||||||
setPhdrs(part);
|
setPhdrs(part);
|
||||||
|
|
||||||
if (config->relocatable)
|
|
||||||
for (OutputSection *sec : outputSections)
|
|
||||||
sec->addr = 0;
|
|
||||||
|
|
||||||
// Handle --print-map(-M)/--Map, --why-extract=, --cref and
|
// Handle --print-map(-M)/--Map, --why-extract=, --cref and
|
||||||
// --print-archive-stats=. Dump them before checkSections() because the files
|
// --print-archive-stats=. Dump them before checkSections() because the files
|
||||||
|
@ -1699,6 +1696,10 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config->relocatable)
|
||||||
|
for (OutputSection *sec : outputSections)
|
||||||
|
sec->addr = 0;
|
||||||
|
|
||||||
// If addrExpr is set, the address may not be a multiple of the alignment.
|
// If addrExpr is set, the address may not be a multiple of the alignment.
|
||||||
// Warn because this is error-prone.
|
// Warn because this is error-prone.
|
||||||
for (SectionCommand *cmd : script->sectionCommands)
|
for (SectionCommand *cmd : script->sectionCommands)
|
||||||
|
|
Loading…
Reference in New Issue