debug/elf: lacks support for PPC relocations

Bug #1431388 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Fix Released
Medium
gccgo-5 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

debug/elf supports 64-bit powerpc, 32-bit and 64-bit arm, 386 and amd64 relocations: the final architecture that ubuntu is built for is 32-bit powerpc. It would be nice to add this so that we can build and use cgo using packages on all our platforms.

https://github.com/golang/go/issues/10118

Revision history for this message
In , Doko-v (doko-v) wrote :

tracking this here, because golang doesn't support ppc32 (yet).

https://github.com/golang/go/issues/10118

debug/elf supports 64-bit powerpc, 32-bit and 64-bit arm, 386 and amd64 relocations, but not 32bit powerpc.

Matthias Klose (doko)
Changed in gccgo-5 (Ubuntu):
status: New → Confirmed
Changed in gcc:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Stéphane Graber (stgraber) wrote :

So with the recent cgo powerpc cherry-pick, I now get the following (unsure if it's the relocation issue or some other missing cgo arch-specific value somewhere).

(vivid-powerpc-sbuild)root@winton-06:~# cat test.go
package main

/*
#include <stdio.h>

void hello() {
        printf("Hello world!\n");
}
*/
import "C"

func main() {
    C.hello()
}

(vivid-powerpc-sbuild)root@winton-06:~# go build -v -x test.go
WORK=/tmp/go-build320378268
command-line-arguments
mkdir -p $WORK/command-line-arguments/_obj/
cd /root
CGO_LDFLAGS="-g" "-O2" /usr/lib/gcc/powerpc-linux-gnu/5/cgo -objdir $WORK/command-line-arguments/_obj/ -gccgo -- -I $WORK/command-line-arguments/_obj/ test.go
# command-line-arguments
./test.go:13:5: call of non-function C.hello

(vivid-powerpc-sbuild)root@winton-06:~# go version
go version go1.4.2 gccgo (Ubuntu 5-20150309-1ubuntu3) 5.0.0 20150310 (experimental) [trunk revision 221296] linux/ppc
(vivid-powerpc-sbuild)root@winton-06:~#

Revision history for this message
In , I-ian-1 (i-ian-1) wrote :

Author: ian
Date: Tue Mar 24 20:55:43 2015
New Revision: 221644

URL: https://gcc.gnu.org/viewcvs?rev=221644&root=gcc&view=rev
Log:
 PR go/65417
debug/elf: support reading debug info from 32-bit PPC objects

This is a backport of http://golang.org/7590 from the master
Go library.

Added:
    trunk/libgo/go/debug/elf/testdata/go-relocation-test-gcc5-ppc.obj (with props)
Modified:
    trunk/libgo/go/debug/elf/file.go
    trunk/libgo/go/debug/elf/file_test.go

Propchange: trunk/libgo/go/debug/elf/testdata/go-relocation-test-gcc5-ppc.obj
            ('svn:mime-type' added)

Revision history for this message
In , Ian Lance Taylor (ianlancetaylor) wrote :

Fixed.

Changed in gcc:
status: New → Fix Released
Changed in gccgo-5 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.