On Mon, Oct 06, 2014 at 07:29:33AM -0700, Ian Lance Taylor wrote:
> On Mon, Oct 6, 2014 at 12:42 AM, Dominik Vogt <v...@linux.vnet.ibm.com> wrote:
> > On s390[x] the symbol value of a section symbol is definitely not
> > zero.
> 
> Is true even in an object file?

No.

> I agree that in an executable a
> section symbol will have a non-zero value, but that case doesn't arise
> since an executable won't have (non-dynamic) relocations.  But I'm
> quite surprised that hear that the section symbol would be non-zero in
> an object file.

I spent a day looking at that issue again, and while it's true
that section symbols don't necessarily have a zero value, that is
not the problem here.  The problem is about how cgo determines the
names of functions(?) from an object file.  On s390 we need to do
an indirect lookup of (non-section-)symbols to find the names, and
the symbol value is not zero.

The only points in that patch are that on one hand - as far as I
know - the Abi does not guarantee that section symbols are either
zero or not relocated, even if that may be the case in reality.
And on the other hand, if that code is ever modified to handle
non-section symbols, it's not obvious that you not only need to
remove the test for the symbol type but also modify the
calculations below.  So, apply the patch or drop it as you like,
but in any case, at least a comment in the code would improve
maintainability.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

Reply via email to