Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
debug/elf: add File.DynValue method to look up DynTag values #18681
Currently there is no method/function to convert elf.Symbol.Info to SymBind and SymType, even thought there is a function ST_INFO to convert SymBind and SymType into uint8.
We probably should have created a new type for Symbol.Info, but we can't do that before Go 2.
Therefore I propose the addition of the following two methods to elf.Symbol:
Perhaps we could also make elf.Symbol implement Stringer, but I'm not sure about the format yet. Any suggestions?
Additionally, the elf package looks like automated conversion from elf.h as it contains a lot of top-level functions will non-idiolmatic names (R_INFO, R_SYM32, etc.) without any docs. For Go 2, we should get rid of them, and turn them into proper methods with idiomatic names.
I also have more proposed addition to the debug/elf package. Should I write a design docs instead? Or maintain a fork of debug/elf?
It's probably too heavyweight for such small additions. I will just list them here:
If you'd like to send a CL or file a separate issue for DynValue, that's fine. You might want to make the implementation build a cache to avoid every call being O(n). I also am not sure if the result should be uint64 or uint64, but I'll leave it to the actual review. No need for a formal proposal for that.
Will retitle for DynValue and accept.