[PATCH] D32587: Add llvm::object::getELFSectionTypeName()

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 08:18:41 PDT 2017


ruiu added inline comments.


================
Comment at: lib/Object/ELF.cpp:236
+  default:
+    return "";
+  }
----------------
arichardson wrote:
> ruiu wrote:
> > It is probably more convenient to return 0x<hex> from this function for unknown types.
> This would mean that llvm-readobj would output `Type: 0x1234567 (0x1234567)` as it always appends the hex value. Also we can't return a const char* then and would need to return std::string.
> 
> As the name of the function is getELFSectionTypeName() I think it is fine to return "" for unknown names because there is no known name for that section type. 
Then how about returning "Unknown"? That's what `getELFRelocationTypeName` defined above is doing, so it is good from the perspective of consistency too.


https://reviews.llvm.org/D32587





More information about the llvm-commits mailing list