[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/977] ld test weak fails on cygwin
From: |
dave dot korn dot cygwin at gmail dot com |
Subject: |
[Bug ld/977] ld test weak fails on cygwin |
Date: |
24 May 2009 19:20:00 -0000 |
------- Additional Comments From dave dot korn dot cygwin at gmail dot com
2009-05-24 19:19 -------
Created an attachment (id=3963)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=3963&action=view)
Examination of absolute (non-pc-relative) relocs against weak syms in MS and
GNU
At 16kB, this detailed examination is probably a bit long to post in a
comment, so I am attaching it. The executive summary:
-----------------------------------------------------------------------------
My conclusion from this is that GAS' behaviour is currently incorrect w.r.t the
generation of MS-style weak externals, and should be adapted to match the
behaviour of MASM. This change alone will resolve the testcase and PR977, and
by all appearances should be more correct and interoperable than the current
situation.
-----------------------------------------------------------------------------
and to prove it I've made the assembler and linker match what the MS tools do:
-----------------------------------------------------------------------------
MS tools:
Contents of section .data:
401000 28104000 0c104000 56565656 78787878 (address@hidden@.VVVVxxxx
401010 2b1d4000 0d1c4000 35134000 0d1f4000 address@hidden@address@hidden@.
401020 28104000 0c104000 12121212 34343434 (address@hidden@.....4444
401030 35134000 0d1f4000 2b1d4000 0d1c4000 address@hidden@address@hidden@.
Unpatched binutils:
Contents of section .text:
401000 30104000 0c104000 56565656 78787878 address@hidden@.VVVVxxxx
^^
401010 331d4000 0d1c4000 3d134000 0d1f4000 address@hidden@address@hidden@.
^^ ^^
401020 28104000 18104000 12121212 34343434 (address@hidden@.....4444
^^
401030 35134000 191f4000 2b1d4000 191c4000 address@hidden@address@hidden@.
^^ ^^
With the patch included in the previous attachment (examples.tar.bz2):
Contents of section .text:
401000 28104000 0c104000 56565656 78787878 (address@hidden@.VVVVxxxx
401010 2b1d4000 0d1c4000 35134000 0d1f4000 address@hidden@address@hidden@.
401020 28104000 0c104000 12121212 34343434 (address@hidden@.....4444
401030 35134000 0d1f4000 2b1d4000 0d1c4000 address@hidden@address@hidden@.
-----------------------------------------------------------------------------
Full details inside. More to follow re: pc-relative relocs.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=977
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/977] ld test weak fails on cygwin, christian dot joensson at gmail dot com, 2009/05/05
- [Bug ld/977] ld test weak fails on cygwin, dave dot korn dot cygwin at gmail dot com, 2009/05/05
- [Bug ld/977] ld test weak fails on cygwin, dave dot korn dot cygwin at gmail dot com, 2009/05/24
- [Bug ld/977] ld test weak fails on cygwin,
dave dot korn dot cygwin at gmail dot com <=
- [Bug ld/977] ld test weak fails on cygwin, dave dot korn dot cygwin at gmail dot com, 2009/05/24
- [Bug ld/977] ld test weak fails on cygwin, dave dot korn dot cygwin at gmail dot com, 2009/05/28
- [Bug ld/977] ld test weak fails on cygwin, dave dot korn dot cygwin at gmail dot com, 2009/05/28