writeInt(Buf + Data->Offset, Data->Expression().getValue(), Data->Size);
}
-bool LinkerScript::hasLMA(StringRef Name) {
+bool LinkerScript::hasLMA(OutputSection *Sec) {
for (BaseCommand *Base : Opt.Commands)
if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base))
- if (Cmd->LMAExpr && Cmd->Name == Name)
+ if (Cmd->LMAExpr && Cmd->Sec == Sec)
return true;
return false;
}
bool ignoreInterpSection();
llvm::Optional<uint32_t> getFiller(OutputSection *Sec);
- bool hasLMA(StringRef Name);
+ bool hasLMA(OutputSection *Sec);
bool shouldKeep(InputSectionBase *S);
void assignOffsets(OutputSectionCommand *Cmd);
void placeOrphanSections();
// different flags or is loaded at a discontiguous address using AT linker
// script command.
uint64_t NewFlags = computeFlags(Sec->getPhdrFlags());
- if (Script->hasLMA(Sec->Name) || Flags != NewFlags) {
+ if (Script->hasLMA(Sec) || Flags != NewFlags) {
Load = AddHdr(PT_LOAD, NewFlags);
Flags = NewFlags;
}
PhdrEntry *Note = nullptr;
for (OutputSection *Sec : OutputSections) {
if (Sec->Type == SHT_NOTE) {
- if (!Note || Script->hasLMA(Sec->Name))
+ if (!Note || Script->hasLMA(Sec))
Note = AddHdr(PT_NOTE, PF_R);
Note->add(Sec);
} else {