• Pietro Gagliardi's avatar
    debug/elf: add (*File).DynamicSymbols, ErrNoSymbols, and tests for… · f5b600f7
    Pietro Gagliardi authored
    debug/elf: add (*File).DynamicSymbols, ErrNoSymbols, and tests for (*File).Symbols and (*File).DynamicSymbols, and formalize symbol order.
    
    Added a complement to (*File).Symbols for the dynamic symbol table.
    Would be useful, for instance, if seraching for certain shared objects
    compatible with certain libraries (for instance, LADSPA requires an
    exported symbol "ladspa_descriptor").
    
    Added a variable ErrNoSymbols that canonicalizes a return from
    (*File).Symbols and (*File).DyanmicSymbols if the file has no symbols.
    
    Added tests for both (*File).Symbols and (*File).DynamicSymbols;
    there was never a test for (*File).Symbols at all. A small C program using
    libelf, included in the test data, was used to produce the golden
    symbols to compare against.
    
    As part of the requirements for testing, (*File).Symbols and (*File).DynamicSymbols now document the order in which the symbol tables are returned (in the order the symbols appear in the file).
    
    All tests currently pass.
    
    LGTM=iant
    R=golang-codereviews, iant
    CC=golang-codereviews
    https://golang.org/cl/107530043
    f5b600f7
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...