Skip to content

cmd/link: support PIE when using the external linker #6940

Closed
@gopherbot

Description

@gopherbot

by peter.volkov:

I'm building current tip of go and one test fails:

--- FAIL: TestCgoCrashHandler (1.02 seconds)
    crash_test.go:80: output:
        # command-line-arguments
        /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/go-link-ynzhxL/go.o: relocation R_X86_64_32 against `main.func·001·f' can not be used when making a shared object; recompile with -fPIC
        /var/tmp/go-link-ynzhxL/go.o: could not read symbols: Bad value
        collect2: error: ld returned 1 exit status
        /home/peter/projects/go/go/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100
        
        
        wanted:
        main: recovered done
        new-thread: recovered done
        second-new-thread: recovered done
        main-again: recovered done
--- FAIL: TestCgoSignalDeadlock (0.75 seconds)
    crash_cgo_test.go:25: expected "OK\n", but got "# command-line-arguments\n/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/go-link-T4Mx9x/go.o: relocation R_X86_64_32 against `type.*' can not be used when making a shared object; recompile with -fPIC\n/var/tmp/go-link-T4Mx9x/go.o: could not read symbols: Bad value\ncollect2: error: ld returned 1 exit status\n/home/peter/projects/go/go/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100\n"
--- FAIL: TestCgoTraceback (0.88 seconds)
    crash_cgo_test.go:33: expected "OK\n", but got "# command-line-arguments\n/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/go-link-WdQPCq/go.o: relocation R_X86_64_32 against `type.*' can not be used when making a shared object; recompile with -fPIC\n/var/tmp/go-link-WdQPCq/go.o: could not read symbols: Bad value\ncollect2: error: ld returned 1 exit status\n/home/peter/projects/go/go/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100\n"
FAIL
FAIL    runtime 15.776s


go version devel +1e3f306f9d46 Thu Dec 12 06:40:16 2013 -0800 linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions