Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/ld: bad handling of multiple section symbols (with different values) for PE COFF object #3322

Closed
minux opened this issue Mar 14, 2012 · 6 comments

Comments

@minux
Copy link
Member

minux commented Mar 14, 2012

What steps will reproduce the problem?
unzip ldbug.zip
cd ldbug
run.bat

What is the expected output? What do you see instead?
Expected "hwllo", but I got "HAHA"


if you reverse the two files (h.o and h2.o) on 'gcc -Wl,-r' cmdline,
you will get the expected output. It seems the relocation doesn't
take the addend into account.

Attachments:

  1. ldbug.zip (757 bytes)
@alexbrainman
Copy link
Member

Comment 1:

Perhaps a dup of https://golang.org/issue/2601 ?
Alex

@minux
Copy link
Member Author

minux commented Mar 15, 2012

Comment 2:

This bug also occurs on Linux/amd64. The greeting pointer will be zero if
all files are compiled natively.
I'm glad that I can debug this issue on Linux.
PS: Our linker is so powerful that I can copy the COFF hh.o to Linux, and
link a Linux ELF binary from it.

Labels changed: added priority-go1, removed priority-triage, os-windows.

@minux
Copy link
Member Author

minux commented Mar 16, 2012

Comment 3:

I don't think this issue is a dup of issue #2601.
(The reason is simple, CL 5823059 fixes this issue, but not that issue.)

Status changed to Started.

@minux
Copy link
Member Author

minux commented Mar 16, 2012

Comment 4:

This is not specific to amd64, but specific to ldpe() in cmd/ld/ldpe.c.

Labels changed: removed arch-x86-64.

@rsc
Copy link
Contributor

rsc commented Mar 26, 2012

Comment 5:

It's too late for linker changes; this will have to wait until after Go 1.

Labels changed: added priority-later, removed priority-go1.

@minux
Copy link
Member Author

minux commented May 22, 2012

Comment 6:

This issue was closed by revision 1c4b77a.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants