forked from OSchip/llvm-project
parent
1602605bf8
commit
f949f7f15e
|
@ -650,25 +650,22 @@ OutputSectionFactory<ELFT>::create(InputSectionBase<ELFT> *C,
|
|||
OutputSectionBase<ELFT> *&Sec = Map[Key];
|
||||
if (Sec)
|
||||
return {Sec, false};
|
||||
Sec = createAux(C, Key);
|
||||
return {Sec, true};
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
OutputSectionBase<ELFT> *
|
||||
OutputSectionFactory<ELFT>::createAux(InputSectionBase<ELFT> *C,
|
||||
const SectionKey<ELFT::Is64Bits> &Key) {
|
||||
switch (C->SectionKind) {
|
||||
case InputSectionBase<ELFT>::Regular:
|
||||
return new OutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
|
||||
Sec = new OutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
|
||||
break;
|
||||
case InputSectionBase<ELFT>::EHFrame:
|
||||
return new EHOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
|
||||
Sec = new EHOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
|
||||
break;
|
||||
case InputSectionBase<ELFT>::Merge:
|
||||
return new MergeOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
|
||||
Sec = new MergeOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
|
||||
break;
|
||||
case InputSectionBase<ELFT>::MipsReginfo:
|
||||
return new MipsReginfoOutputSection<ELFT>();
|
||||
Sec = new MipsReginfoOutputSection<ELFT>();
|
||||
break;
|
||||
}
|
||||
llvm_unreachable("Unknown output section type");
|
||||
return {Sec, true};
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
|
|
Loading…
Reference in New Issue