@@ -110,7 +110,6 @@ template <class ELFT> class ELFState {
110
110
typedef typename ELFT::Rela Elf_Rela;
111
111
typedef typename ELFT::Relr Elf_Relr;
112
112
typedef typename ELFT::Dyn Elf_Dyn;
113
- typedef typename ELFT::uint uintX_t;
114
113
115
114
enum class SymtabType { Static, Dynamic };
116
115
@@ -166,9 +165,6 @@ template <class ELFT> class ELFState {
166
165
void writeSectionContent (Elf_Shdr &SHeader,
167
166
const ELFYAML::RelocationSection &Section,
168
167
ContiguousBlobAccumulator &CBA);
169
- void writeSectionContent (Elf_Shdr &SHeader,
170
- const ELFYAML::RelrSection &Section,
171
- ContiguousBlobAccumulator &CBA);
172
168
void writeSectionContent (Elf_Shdr &SHeader, const ELFYAML::Group &Group,
173
169
ContiguousBlobAccumulator &CBA);
174
170
void writeSectionContent (Elf_Shdr &SHeader,
@@ -458,8 +454,6 @@ void ELFState<ELFT>::initSectionHeaders(std::vector<Elf_Shdr> &SHeaders,
458
454
writeSectionContent (SHeader, *S, CBA);
459
455
} else if (auto S = dyn_cast<ELFYAML::RelocationSection>(Sec)) {
460
456
writeSectionContent (SHeader, *S, CBA);
461
- } else if (auto S = dyn_cast<ELFYAML::RelrSection>(Sec)) {
462
- writeSectionContent (SHeader, *S, CBA);
463
457
} else if (auto S = dyn_cast<ELFYAML::Group>(Sec)) {
464
458
writeSectionContent (SHeader, *S, CBA);
465
459
} else if (auto S = dyn_cast<ELFYAML::MipsABIFlags>(Sec)) {
@@ -776,6 +770,10 @@ void ELFState<ELFT>::writeSectionContent(
776
770
777
771
if (Section.EntSize )
778
772
SHeader.sh_entsize = *Section.EntSize ;
773
+ else if (Section.Type == llvm::ELF::SHT_RELR)
774
+ SHeader.sh_entsize = sizeof (Elf_Relr);
775
+ else
776
+ SHeader.sh_entsize = 0 ;
779
777
780
778
if (Section.Info )
781
779
SHeader.sh_info = *Section.Info ;
@@ -829,30 +827,6 @@ void ELFState<ELFT>::writeSectionContent(
829
827
}
830
828
}
831
829
832
- template <class ELFT >
833
- void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader,
834
- const ELFYAML::RelrSection &Section,
835
- ContiguousBlobAccumulator &CBA) {
836
- raw_ostream &OS =
837
- CBA.getOSAndAlignedOffset (SHeader.sh_offset , SHeader.sh_addralign );
838
- SHeader.sh_entsize =
839
- Section.EntSize ? uint64_t (*Section.EntSize ) : sizeof (Elf_Relr);
840
-
841
- if (Section.Content ) {
842
- SHeader.sh_size = writeContent (OS, Section.Content , None);
843
- return ;
844
- }
845
-
846
- for (llvm::yaml::Hex64 E : *Section.Entries ) {
847
- if (!ELFT::Is64Bits && E > UINT32_MAX)
848
- reportError (Section.Name + " : the value is too large for 32-bits: 0x" +
849
- Twine::utohexstr (E));
850
- support::endian::write<uintX_t>(OS, E, ELFT::TargetEndianness);
851
- }
852
-
853
- SHeader.sh_size = sizeof (uintX_t) * Section.Entries ->size ();
854
- }
855
-
856
830
template <class ELFT >
857
831
void ELFState<ELFT>::writeSectionContent(
858
832
Elf_Shdr &SHeader, const ELFYAML::SymtabShndxSection &Shndx,
@@ -915,6 +889,7 @@ template <class ELFT>
915
889
void ELFState<ELFT>::writeSectionContent(
916
890
Elf_Shdr &SHeader, const ELFYAML::StackSizesSection &Section,
917
891
ContiguousBlobAccumulator &CBA) {
892
+ using uintX_t = typename ELFT::uint;
918
893
raw_ostream &OS =
919
894
CBA.getOSAndAlignedOffset (SHeader.sh_offset , SHeader.sh_addralign );
920
895
@@ -1140,6 +1115,8 @@ template <class ELFT>
1140
1115
void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader,
1141
1116
const ELFYAML::DynamicSection &Section,
1142
1117
ContiguousBlobAccumulator &CBA) {
1118
+ typedef typename ELFT::uint uintX_t;
1119
+
1143
1120
assert (Section.Type == llvm::ELF::SHT_DYNAMIC &&
1144
1121
" Section type is not SHT_DYNAMIC" );
1145
1122
0 commit comments