forked from OSchip/llvm-project
parent
68cb947cc9
commit
a348532ec3
|
|
@ -218,9 +218,8 @@ template <class ELFT> void LinkerScript<ELFT>::filter() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ELFT>
|
template <class ELFT> void LinkerScript<ELFT>::assignAddresses() {
|
||||||
void LinkerScript<ELFT>::assignAddresses(
|
ArrayRef<OutputSectionBase<ELFT> *> Sections = *OutputSections;
|
||||||
ArrayRef<OutputSectionBase<ELFT> *> Sections) {
|
|
||||||
// Orphan sections are sections present in the input files which
|
// Orphan sections are sections present in the input files which
|
||||||
// are not explicitly placed into the output file by the linker script.
|
// are not explicitly placed into the output file by the linker script.
|
||||||
// We place orphan sections at end of file.
|
// We place orphan sections at end of file.
|
||||||
|
|
@ -289,8 +288,8 @@ void LinkerScript<ELFT>::assignAddresses(
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
std::vector<PhdrEntry<ELFT>>
|
std::vector<PhdrEntry<ELFT>> LinkerScript<ELFT>::createPhdrs() {
|
||||||
LinkerScript<ELFT>::createPhdrs(ArrayRef<OutputSectionBase<ELFT> *> Sections) {
|
ArrayRef<OutputSectionBase<ELFT> *> Sections = *OutputSections;
|
||||||
std::vector<PhdrEntry<ELFT>> Ret;
|
std::vector<PhdrEntry<ELFT>> Ret;
|
||||||
|
|
||||||
for (const PhdrsCommand &Cmd : Opt.PhdrsCommands) {
|
for (const PhdrsCommand &Cmd : Opt.PhdrsCommands) {
|
||||||
|
|
|
||||||
|
|
@ -133,12 +133,11 @@ public:
|
||||||
void createSections(std::vector<OutputSectionBase<ELFT> *> *Out,
|
void createSections(std::vector<OutputSectionBase<ELFT> *> *Out,
|
||||||
OutputSectionFactory<ELFT> &Factory);
|
OutputSectionFactory<ELFT> &Factory);
|
||||||
|
|
||||||
std::vector<PhdrEntry<ELFT>>
|
std::vector<PhdrEntry<ELFT>> createPhdrs();
|
||||||
createPhdrs(ArrayRef<OutputSectionBase<ELFT> *> S);
|
|
||||||
|
|
||||||
ArrayRef<uint8_t> getFiller(StringRef Name);
|
ArrayRef<uint8_t> getFiller(StringRef Name);
|
||||||
bool shouldKeep(InputSectionBase<ELFT> *S);
|
bool shouldKeep(InputSectionBase<ELFT> *S);
|
||||||
void assignAddresses(ArrayRef<OutputSectionBase<ELFT> *> S);
|
void assignAddresses();
|
||||||
int compareSections(StringRef A, StringRef B);
|
int compareSections(StringRef A, StringRef B);
|
||||||
void addScriptedSymbols();
|
void addScriptedSymbols();
|
||||||
bool hasPhdrsCommands();
|
bool hasPhdrsCommands();
|
||||||
|
|
|
||||||
|
|
@ -245,12 +245,11 @@ template <class ELFT> void Writer<ELFT>::run() {
|
||||||
if (Config->Relocatable) {
|
if (Config->Relocatable) {
|
||||||
assignFileOffsets();
|
assignFileOffsets();
|
||||||
} else {
|
} else {
|
||||||
Phdrs = Script<ELFT>::X->hasPhdrsCommands()
|
Phdrs = Script<ELFT>::X->hasPhdrsCommands() ? Script<ELFT>::X->createPhdrs()
|
||||||
? Script<ELFT>::X->createPhdrs(OutputSections)
|
|
||||||
: createPhdrs();
|
: createPhdrs();
|
||||||
fixHeaders();
|
fixHeaders();
|
||||||
if (ScriptConfig->HasContents) {
|
if (ScriptConfig->HasContents) {
|
||||||
Script<ELFT>::X->assignAddresses(OutputSections);
|
Script<ELFT>::X->assignAddresses();
|
||||||
} else {
|
} else {
|
||||||
fixSectionAlignments();
|
fixSectionAlignments();
|
||||||
assignAddresses();
|
assignAddresses();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue