------- 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 (....@...@.VVVVxxxx 401010 2b1d4000 0d1c4000 35134000 0d1f4000 +...@...@....@...@. 401020 28104000 0c104000 12121212 34343434 (....@...@.....4444 401030 35134000 0d1f4000 2b1d4000 0d1c4000 5...@...@....@...@. Unpatched binutils: Contents of section .text: 401000 30104000 0c104000 56565656 78787878 0...@...@.VVVVxxxx ^^ 401010 331d4000 0d1c4000 3d134000 0d1f4000 3...@...@....@...@. ^^ ^^ 401020 28104000 18104000 12121212 34343434 (....@...@.....4444 ^^ 401030 35134000 191f4000 2b1d4000 191c4000 5...@...@....@...@. ^^ ^^ With the patch included in the previous attachment (examples.tar.bz2): Contents of section .text: 401000 28104000 0c104000 56565656 78787878 (....@...@.VVVVxxxx 401010 2b1d4000 0d1c4000 35134000 0d1f4000 +...@...@....@...@. 401020 28104000 0c104000 12121212 34343434 (....@...@.....4444 401030 35134000 0d1f4000 2b1d4000 0d1c4000 5...@...@....@...@. ----------------------------------------------------------------------------- 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-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils