@@ -285,7 +285,6 @@ template <typename ELFT> class ELFDumper : public ObjDumper {
285285
286286 virtual void printRelRelaReloc (const Relocation<ELFT> &R,
287287 const RelSymbol<ELFT> &RelSym) = 0;
288- virtual void printRelrReloc (const Elf_Relr &R) = 0;
289288 virtual void printDynamicRelocHeader (unsigned Type, StringRef Name,
290289 const DynRegionInfo &Reg) {}
291290 void printReloc (const Relocation<ELFT> &R, unsigned RelIndex,
@@ -294,11 +293,10 @@ template <typename ELFT> class ELFDumper : public ObjDumper {
294293 void printDynamicRelocationsHelper ();
295294 void printRelocationsHelper (const Elf_Shdr &Sec);
296295 void forEachRelocationDo (
297- const Elf_Shdr &Sec, bool RawRelr,
296+ const Elf_Shdr &Sec,
298297 llvm::function_ref<void (const Relocation<ELFT> &, unsigned ,
299298 const Elf_Shdr &, const Elf_Shdr *)>
300- RelRelaFn,
301- llvm::function_ref<void(const Elf_Relr &)> RelrFn);
299+ RelRelaFn);
302300
303301 virtual void printSymtabMessage (const Elf_Shdr *Symtab, size_t Offset,
304302 bool NonVisibilityBitsUsed,
@@ -669,7 +667,6 @@ template <typename ELFT> class GNUELFDumper : public ELFDumper<ELFT> {
669667 DataRegion<Elf_Word> ShndxTable, StringRef StrTable,
670668 uint32_t Bucket);
671669 void printRelr (const Elf_Shdr &Sec);
672- void printRelrReloc (const Elf_Relr &R) override ;
673670 void printRelRelaReloc (const Relocation<ELFT> &R,
674671 const RelSymbol<ELFT> &RelSym) override ;
675672 void printSymbol (const Elf_Sym &Symbol, unsigned SymIndex,
@@ -734,7 +731,6 @@ template <typename ELFT> class LLVMELFDumper : public ELFDumper<ELFT> {
734731 bool IsGnu) const override ;
735732
736733private:
737- void printRelrReloc (const Elf_Relr &R) override ;
738734 void printRelRelaReloc (const Relocation<ELFT> &R,
739735 const RelSymbol<ELFT> &RelSym) override ;
740736
@@ -3800,11 +3796,6 @@ template <class ELFT> void GNUELFDumper<ELFT>::printGroupSections() {
38003796 OS << " There are no section groups in this file.\n " ;
38013797}
38023798
3803- template <class ELFT >
3804- void GNUELFDumper<ELFT>::printRelrReloc(const Elf_Relr &R) {
3805- OS << to_string (format_hex_no_prefix (R, ELFT::Is64Bits ? 16 : 8 )) << " \n " ;
3806- }
3807-
38083799template <class ELFT >
38093800void GNUELFDumper<ELFT>::printRelRelaReloc(const Relocation<ELFT> &R,
38103801 const RelSymbol<ELFT> &RelSym) {
@@ -3851,22 +3842,11 @@ template <class ELFT>
38513842static void printRelocHeaderFields (formatted_raw_ostream &OS, unsigned SType,
38523843 const typename ELFT::Ehdr &EHeader) {
38533844 bool IsRela = SType == ELF::SHT_RELA || SType == ELF::SHT_ANDROID_RELA;
3854- bool IsRelr =
3855- SType == ELF::SHT_RELR || SType == ELF::SHT_ANDROID_RELR ||
3856- (EHeader.e_machine == EM_AARCH64 && SType == ELF::SHT_AARCH64_AUTH_RELR);
3857- if (ELFT::Is64Bits)
3858- OS << " " ;
3859- else
3860- OS << " " ;
3861- if (IsRelr && opts::RawRelr)
3862- OS << " Data " ;
3863- else
3864- OS << " Offset" ;
38653845 if (ELFT::Is64Bits)
3866- OS << " Info Type"
3867- << " Symbol's Value Symbol's Name" ;
3846+ OS << " Offset Info Type Symbol's "
3847+ " Value Symbol's Name" ;
38683848 else
3869- OS << " Info Type Sym. Value Symbol's Name" ;
3849+ OS << " Offset Info Type Sym. Value Symbol's Name" ;
38703850 if (IsRela)
38713851 OS << " + Addend" ;
38723852 OS << " \n " ;
@@ -3894,10 +3874,10 @@ static bool isRelocationSec(const typename ELFT::Shdr &Sec,
38943874
38953875template <class ELFT > void GNUELFDumper<ELFT>::printRelocations() {
38963876 auto PrintAsRelr = [&](const Elf_Shdr &Sec) {
3897- return !opts::RawRelr && ( Sec.sh_type == ELF::SHT_RELR ||
3898- Sec.sh_type == ELF::SHT_ANDROID_RELR ||
3899- (this ->Obj .getHeader ().e_machine == EM_AARCH64 &&
3900- Sec.sh_type == ELF::SHT_AARCH64_AUTH_RELR) );
3877+ return Sec.sh_type == ELF::SHT_RELR ||
3878+ Sec.sh_type == ELF::SHT_ANDROID_RELR ||
3879+ (this ->Obj .getHeader ().e_machine == EM_AARCH64 &&
3880+ Sec.sh_type == ELF::SHT_AARCH64_AUTH_RELR);
39013881 };
39023882 auto GetEntriesNum = [&](const Elf_Shdr &Sec) -> Expected<size_t > {
39033883 // Android's packed relocation section needs to be unpacked first
@@ -4902,10 +4882,8 @@ void ELFDumper<ELFT>::printDynamicReloc(const Relocation<ELFT> &R) {
49024882template <class ELFT >
49034883void ELFDumper<ELFT>::printRelocationsHelper(const Elf_Shdr &Sec) {
49044884 this ->forEachRelocationDo (
4905- Sec, opts::RawRelr,
4906- [&](const Relocation<ELFT> &R, unsigned Ndx, const Elf_Shdr &Sec,
4907- const Elf_Shdr *SymTab) { printReloc (R, Ndx, Sec, SymTab); },
4908- [&](const Elf_Relr &R) { printRelrReloc (R); });
4885+ Sec, [&](const Relocation<ELFT> &R, unsigned Ndx, const Elf_Shdr &Sec,
4886+ const Elf_Shdr *SymTab) { printReloc (R, Ndx, Sec, SymTab); });
49094887}
49104888
49114889template <class ELFT > void ELFDumper<ELFT>::printDynamicRelocationsHelper() {
@@ -6371,11 +6349,10 @@ void ELFDumper<ELFT>::printDependentLibsHelper(
63716349
63726350template <class ELFT >
63736351void ELFDumper<ELFT>::forEachRelocationDo(
6374- const Elf_Shdr &Sec, bool RawRelr,
6352+ const Elf_Shdr &Sec,
63756353 llvm::function_ref<void (const Relocation<ELFT> &, unsigned ,
63766354 const Elf_Shdr &, const Elf_Shdr *)>
6377- RelRelaFn,
6378- llvm::function_ref<void (const Elf_Relr &)> RelrFn) {
6355+ RelRelaFn) {
63796356 auto Warn = [&](Error &&E,
63806357 const Twine &Prefix = " unable to read relocations from" ) {
63816358 this ->reportUniqueWarning (Prefix + " " + describe (Sec) + " : " +
@@ -6427,11 +6404,6 @@ void ELFDumper<ELFT>::forEachRelocationDo(
64276404 Warn (RangeOrErr.takeError ());
64286405 break ;
64296406 }
6430- if (RawRelr) {
6431- for (const Elf_Relr &R : *RangeOrErr)
6432- RelrFn (R);
6433- break ;
6434- }
64356407
64366408 for (const Elf_Rel &R : Obj.decode_relrs (*RangeOrErr))
64376409 RelRelaFn (Relocation<ELFT>(R, IsMips64EL), RelNdx++, Sec,
@@ -6741,9 +6713,8 @@ void ELFDumper<ELFT>::printRelocatableStackSizes(
67416713 DataExtractor Data (Contents, Obj.isLE (), sizeof (Elf_Addr));
67426714
67436715 forEachRelocationDo (
6744- *RelocSec, /* RawRelr=*/ false ,
6745- [&](const Relocation<ELFT> &R, unsigned Ndx, const Elf_Shdr &Sec,
6746- const Elf_Shdr *SymTab) {
6716+ *RelocSec, [&](const Relocation<ELFT> &R, unsigned Ndx,
6717+ const Elf_Shdr &Sec, const Elf_Shdr *SymTab) {
67476718 if (!IsSupportedFn || !IsSupportedFn (R.Type )) {
67486719 reportUniqueWarning (
67496720 describe (*RelocSec) +
@@ -6754,10 +6725,6 @@ void ELFDumper<ELFT>::printRelocatableStackSizes(
67546725
67556726 this ->printStackSize (R, *RelocSec, Ndx, SymTab, FunctionSec,
67566727 *StackSizesELFSec, Resolver, Data);
6757- },
6758- [](const Elf_Relr &) {
6759- llvm_unreachable (" can't get here, because we only support "
6760- " SHT_REL/SHT_RELA sections" );
67616728 });
67626729 }
67636730}
@@ -7147,11 +7114,6 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printRelocations() {
71477114 }
71487115}
71497116
7150- template <class ELFT >
7151- void LLVMELFDumper<ELFT>::printRelrReloc(const Elf_Relr &R) {
7152- W.startLine () << W.hex (R) << " \n " ;
7153- }
7154-
71557117template <class ELFT >
71567118void LLVMELFDumper<ELFT>::printExpandedRelRelaReloc(const Relocation<ELFT> &R,
71577119 StringRef SymbolName,
0 commit comments