@@ -285,7 +285,6 @@ template <typename ELFT> class ELFDumper : public ObjDumper {
285
285
286
286
virtual void printRelRelaReloc (const Relocation<ELFT> &R,
287
287
const RelSymbol<ELFT> &RelSym) = 0;
288
- virtual void printRelrReloc (const Elf_Relr &R) = 0;
289
288
virtual void printDynamicRelocHeader (unsigned Type, StringRef Name,
290
289
const DynRegionInfo &Reg) {}
291
290
void printReloc (const Relocation<ELFT> &R, unsigned RelIndex,
@@ -294,11 +293,10 @@ template <typename ELFT> class ELFDumper : public ObjDumper {
294
293
void printDynamicRelocationsHelper ();
295
294
void printRelocationsHelper (const Elf_Shdr &Sec);
296
295
void forEachRelocationDo (
297
- const Elf_Shdr &Sec, bool RawRelr,
296
+ const Elf_Shdr &Sec,
298
297
llvm::function_ref<void (const Relocation<ELFT> &, unsigned ,
299
298
const Elf_Shdr &, const Elf_Shdr *)>
300
- RelRelaFn,
301
- llvm::function_ref<void(const Elf_Relr &)> RelrFn);
299
+ RelRelaFn);
302
300
303
301
virtual void printSymtabMessage (const Elf_Shdr *Symtab, size_t Offset,
304
302
bool NonVisibilityBitsUsed,
@@ -669,7 +667,6 @@ template <typename ELFT> class GNUELFDumper : public ELFDumper<ELFT> {
669
667
DataRegion<Elf_Word> ShndxTable, StringRef StrTable,
670
668
uint32_t Bucket);
671
669
void printRelr (const Elf_Shdr &Sec);
672
- void printRelrReloc (const Elf_Relr &R) override ;
673
670
void printRelRelaReloc (const Relocation<ELFT> &R,
674
671
const RelSymbol<ELFT> &RelSym) override ;
675
672
void printSymbol (const Elf_Sym &Symbol, unsigned SymIndex,
@@ -734,7 +731,6 @@ template <typename ELFT> class LLVMELFDumper : public ELFDumper<ELFT> {
734
731
bool IsGnu) const override ;
735
732
736
733
private:
737
- void printRelrReloc (const Elf_Relr &R) override ;
738
734
void printRelRelaReloc (const Relocation<ELFT> &R,
739
735
const RelSymbol<ELFT> &RelSym) override ;
740
736
@@ -3800,11 +3796,6 @@ template <class ELFT> void GNUELFDumper<ELFT>::printGroupSections() {
3800
3796
OS << " There are no section groups in this file.\n " ;
3801
3797
}
3802
3798
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
-
3808
3799
template <class ELFT >
3809
3800
void GNUELFDumper<ELFT>::printRelRelaReloc(const Relocation<ELFT> &R,
3810
3801
const RelSymbol<ELFT> &RelSym) {
@@ -3851,22 +3842,11 @@ template <class ELFT>
3851
3842
static void printRelocHeaderFields (formatted_raw_ostream &OS, unsigned SType,
3852
3843
const typename ELFT::Ehdr &EHeader) {
3853
3844
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" ;
3865
3845
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" ;
3868
3848
else
3869
- OS << " Info Type Sym. Value Symbol's Name" ;
3849
+ OS << " Offset Info Type Sym. Value Symbol's Name" ;
3870
3850
if (IsRela)
3871
3851
OS << " + Addend" ;
3872
3852
OS << " \n " ;
@@ -3894,10 +3874,10 @@ static bool isRelocationSec(const typename ELFT::Shdr &Sec,
3894
3874
3895
3875
template <class ELFT > void GNUELFDumper<ELFT>::printRelocations() {
3896
3876
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);
3901
3881
};
3902
3882
auto GetEntriesNum = [&](const Elf_Shdr &Sec) -> Expected<size_t > {
3903
3883
// Android's packed relocation section needs to be unpacked first
@@ -4902,10 +4882,8 @@ void ELFDumper<ELFT>::printDynamicReloc(const Relocation<ELFT> &R) {
4902
4882
template <class ELFT >
4903
4883
void ELFDumper<ELFT>::printRelocationsHelper(const Elf_Shdr &Sec) {
4904
4884
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); });
4909
4887
}
4910
4888
4911
4889
template <class ELFT > void ELFDumper<ELFT>::printDynamicRelocationsHelper() {
@@ -6371,11 +6349,10 @@ void ELFDumper<ELFT>::printDependentLibsHelper(
6371
6349
6372
6350
template <class ELFT >
6373
6351
void ELFDumper<ELFT>::forEachRelocationDo(
6374
- const Elf_Shdr &Sec, bool RawRelr,
6352
+ const Elf_Shdr &Sec,
6375
6353
llvm::function_ref<void (const Relocation<ELFT> &, unsigned ,
6376
6354
const Elf_Shdr &, const Elf_Shdr *)>
6377
- RelRelaFn,
6378
- llvm::function_ref<void (const Elf_Relr &)> RelrFn) {
6355
+ RelRelaFn) {
6379
6356
auto Warn = [&](Error &&E,
6380
6357
const Twine &Prefix = " unable to read relocations from" ) {
6381
6358
this ->reportUniqueWarning (Prefix + " " + describe (Sec) + " : " +
@@ -6427,11 +6404,6 @@ void ELFDumper<ELFT>::forEachRelocationDo(
6427
6404
Warn (RangeOrErr.takeError ());
6428
6405
break ;
6429
6406
}
6430
- if (RawRelr) {
6431
- for (const Elf_Relr &R : *RangeOrErr)
6432
- RelrFn (R);
6433
- break ;
6434
- }
6435
6407
6436
6408
for (const Elf_Rel &R : Obj.decode_relrs (*RangeOrErr))
6437
6409
RelRelaFn (Relocation<ELFT>(R, IsMips64EL), RelNdx++, Sec,
@@ -6741,9 +6713,8 @@ void ELFDumper<ELFT>::printRelocatableStackSizes(
6741
6713
DataExtractor Data (Contents, Obj.isLE (), sizeof (Elf_Addr));
6742
6714
6743
6715
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) {
6747
6718
if (!IsSupportedFn || !IsSupportedFn (R.Type )) {
6748
6719
reportUniqueWarning (
6749
6720
describe (*RelocSec) +
@@ -6754,10 +6725,6 @@ void ELFDumper<ELFT>::printRelocatableStackSizes(
6754
6725
6755
6726
this ->printStackSize (R, *RelocSec, Ndx, SymTab, FunctionSec,
6756
6727
*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" );
6761
6728
});
6762
6729
}
6763
6730
}
@@ -7147,11 +7114,6 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printRelocations() {
7147
7114
}
7148
7115
}
7149
7116
7150
- template <class ELFT >
7151
- void LLVMELFDumper<ELFT>::printRelrReloc(const Elf_Relr &R) {
7152
- W.startLine () << W.hex (R) << " \n " ;
7153
- }
7154
-
7155
7117
template <class ELFT >
7156
7118
void LLVMELFDumper<ELFT>::printExpandedRelRelaReloc(const Relocation<ELFT> &R,
7157
7119
StringRef SymbolName,
0 commit comments