[PATCH] Replace coff-/elf-dump with llvm-readobj
Shankar Kalpathi Easwaran
shankarke at gmail.com
Thu Apr 11 16:22:59 PDT 2013
================
Comment at: include/llvm/Object/ELF.h:1615
@@ -1630,1 +1614,3 @@
+StringRef ELFObjectFile<ELFT>::getRelocationTypeName(uint32_t Type) const {
+ StringRef Res;
switch (Header->e_machine) {
----------------
you could set by default Res to be unknown and avoid setting it multiple times ?
================
Comment at: test/tools/llvm-readobj/Inputs/relocs.py:2-8
@@ +1,9 @@
+#!/usr/bin/env python
+
+# Generates ELF, COFF and MachO object files for different architectures
+# containing all relocations.
+#
+# To simplify generation, object files are generated with just the proper
+# number of relocations through repeated instructions. Afterwards, the
+# relocations in the object file are patched to their proper value.
+
----------------
It might be good to say what architectures are being supported explicitly.
================
Comment at: tools/llvm-readobj/ELFDumper.cpp:557-562
@@ -555,7 +556,8 @@
SymbolRef Symbol;
if (error(RelI->getOffset(Offset))) return;
+ if (error(RelI->getType(RelocType))) return;
if (error(RelI->getTypeName(RelocName))) return;
if (error(RelI->getAdditionalInfo(Info))) return;
if (error(RelI->getSymbol(Symbol))) return;
if (error(Symbol.getName(SymbolName))) return;
----------------
should this print some sort of error for diagnostics.
================
Comment at: tools/llvm-readobj/MachODumper.cpp:337-342
@@ -335,7 +336,8 @@
SymbolRef Symbol;
if (error(RelI->getOffset(Offset))) return;
+ if (error(RelI->getType(RelocType))) return;
if (error(RelI->getTypeName(RelocName))) return;
if (error(RelI->getAdditionalInfo(Info))) return;
if (error(RelI->getSymbol(Symbol))) return;
if (error(Symbol.getName(SymbolName))) return;
----------------
same here.
http://llvm-reviews.chandlerc.com/D661
BRANCH
convert-tests
ARCANIST PROJECT
llvm
More information about the llvm-commits
mailing list