mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-07 11:33:44 +00:00
4ad9e9b0b0
ELF targets (and maybe COFF) use relocations when referring to strings in the .debug_str section. Handle that in the accelerator table dumper. This commit restores the test/DebugInfo/cross-cu-inlining.ll test to its expected platform independant form, validating that the fix works (this test failed on linux boxes). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222029 91177308-0d34-0410-b5e6-96231b3b80d8
43 lines
918 B
C++
43 lines
918 B
C++
|
|
#include "DWARFRelocMap.h"
|
|
|
|
#include "llvm/ADT/SmallVector.h"
|
|
#include "llvm/DebugInfo/DWARFFormValue.h"
|
|
|
|
#include <cstdint>
|
|
|
|
namespace llvm {
|
|
|
|
class DWARFAcceleratorTable {
|
|
|
|
struct Header {
|
|
uint32_t Magic;
|
|
uint16_t Version;
|
|
uint16_t HashFunction;
|
|
uint32_t NumBuckets;
|
|
uint32_t NumHashes;
|
|
uint32_t HeaderDataLength;
|
|
};
|
|
|
|
struct HeaderData {
|
|
typedef uint16_t AtomType;
|
|
uint32_t DIEOffsetBase;
|
|
SmallVector<std::pair<AtomType, DWARFFormValue>, 1> Atoms;
|
|
};
|
|
|
|
struct Header Hdr;
|
|
struct HeaderData HdrData;
|
|
DataExtractor AccelSection;
|
|
DataExtractor StringSection;
|
|
const RelocAddrMap& Relocs;
|
|
public:
|
|
DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection,
|
|
const RelocAddrMap &Relocs)
|
|
: AccelSection(AccelSection), StringSection(StringSection), Relocs(Relocs) {}
|
|
|
|
bool extract();
|
|
void dump(raw_ostream &OS);
|
|
};
|
|
|
|
}
|