readelf: print addend for RELA relocations without symbol (#292)
* readelf: print addend for RELA relocations without symbol
When processing relocations from a SHT_RELA type section, GNU
readelf displays the value of the 'r_addend' field if no
symbol index is given (that is, 'r_info_sym' is 0).
By also implementing this we can better test the output for
64-bit binaries which commonly use SHT_RELA relocations.
The included test file is the same as tls.elf but compiled
for x86_64. Its code is the following:
__thread int i;
int main(){}
and it is compiled using the following command line:
$ gcc -m64 -o tls64.elf tls.c
* test: add source file for tls{,64}.elf
The comments at the top describe how to compile the source
file into tls.elf and tls64.elf.