On Fri, Oct 03, 2014 at 06:25:55PM -0700, Ian Lance Taylor wrote: > On Tue, Sep 9, 2014 at 5:56 AM, Dominik Vogt <v...@linux.vnet.ibm.com> wrote: > > * libgo/go/debug/elf/file.go (applyRelocationsAMD64): > > Fix the calculation of some relocations; do not assume that the > > symbol > > value is always zero. > > The code checks that it is using only STT_SECTION symbols. An > STT_SECTION symbol in an object file can be reasonably expected to > have a value of zero. Since in practice this only applies to debug > sections, I doubt it would work at all if the STT_SECTION symbol had a > non-zero value and that value were added in. So I'm not convinced > that this patch is necessary.
Well, my x86 knowledge is limited, and the patch is neither required for the s390[x] port nor (at the moment) for x64_64. On s390[x] the symbol value of a section symbol is definitely not zero. In the amd64 Abi I cannot see anything that would enforce that sym.Value is 0 for section symbols, although it seems to be the case on the tested x86_64 system. In any case, if the patch is not committed, we should at least add a comment that the symbol value is omitted from the calculation because it is assumed to be zero. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany