June 11, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #20 from Jerry Quinn <jlquinn@optonline.net> 2013-06-11 07:31:24 PDT ---
jlquinn@wyvern:~/re/test$ /home/jlquinn/dmd2/linux/bin64/dmd junk -L--verbose
/usr/bin/ld: Attempt to open
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o succeeded
/usr/bin/ld: Attempt to open
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o succeeded
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/crtbegin.o
succeeded
/usr/bin/ld: Attempt to open junk.o succeeded
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/crtend.o
succeeded
/usr/bin/ld: Attempt to open
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crtn.o succeeded
/usr/bin/ld: Attempt to open
/home/jlquinn/dmd2/linux/bin64/../lib64/libphobos2.a succeeded
/usr/bin/ld: Attempt to open
/home/jlquinn/dmd2/linux/bin64/../lib64/libpthread.so failed
/usr/bin/ld: Attempt to open
/home/jlquinn/dmd2/linux/bin64/../lib64/libpthread.a failed
/usr/bin/ld: Attempt to open
/home/jlquinn/dmd2/linux/bin64/../lib32/libpthread.so failed
/usr/bin/ld: Attempt to open
/home/jlquinn/dmd2/linux/bin64/../lib32/libpthread.a failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libpthread.so
failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libpthread.a
failed
/usr/bin/ld: Attempt to open
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libpthread.so
succeeded
/usr/bin/ld: Attempt to open /lib/x86_64-linux-gnu/libpthread.so.0 succeeded
/usr/bin/ld: Attempt to open /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a
succeeded
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libm.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libm.a
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libm.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libm.a
failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libm.so failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libm.a failed
/usr/bin/ld: Attempt to open
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libm.so succeeded
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/librt.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/librt.a
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/librt.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/librt.a
failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/librt.so failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/librt.a failed
/usr/bin/ld: Attempt to open
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/librt.so succeeded
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc.a
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc.a
failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.so failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a
succeeded
/usr/bin/ld: Attempt to open
/home/jlquinn/dmd2/linux/bin64/../lib64/libgcc_s.so failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc_s.a
failed
/usr/bin/ld: Attempt to open
/home/jlquinn/dmd2/linux/bin64/../lib32/libgcc_s.so failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc_s.a
failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so
succeeded
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libc.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libc.a
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libc.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libc.a
failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libc.so failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libc.a failed
/usr/bin/ld: Attempt to open
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libc.so succeeded
/usr/bin/ld: Attempt to open /lib/x86_64-linux-gnu/libc.so.6 succeeded
/usr/bin/ld: Attempt to open /usr/lib/x86_64-linux-gnu/libc_nonshared.a
succeeded
/usr/bin/ld: Attempt to open /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
succeeded
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc.a
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc.so
failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc.a
failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.so failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a
succeeded
/usr/bin/ld: Attempt to open
/home/jlquinn/dmd2/linux/bin64/../lib64/libgcc_s.so failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc_s.a
failed
/usr/bin/ld: Attempt to open
/home/jlquinn/dmd2/linux/bin64/../lib32/libgcc_s.so failed
/usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc_s.a
failed
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so
succeeded

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 11, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #21 from Martin Nowak <code@dawg.eu> 2013-06-11 11:53:31 PDT ---
(In reply to comment #20)
> jlquinn@wyvern:~/re/test$ /home/jlquinn/dmd2/linux/bin64/dmd junk -L--verbose

Please with the linker version and the linker script.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 11, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274


Maxim Fomin <maxim@maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim@maxim-fomin.ru


--- Comment #22 from Maxim Fomin <maxim@maxim-fomin.ru> 2013-06-11 12:21:59 PDT ---
(In reply to comment #18)
> Created an attachment (id=1224) [details]
> Crashing binary
> 
> cat > junk.d
> void main() {
> }
> 
> dmd junk.d
> 
> This is the executable junk.

Object file (dmd -c) would be helpful too.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 11, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #23 from Jerry Quinn <jlquinn@optonline.net> 2013-06-11 13:09:09 PDT ---
I assume this is the linker script generated by dmd -v:

gcc junk.o -o junk -m64 -Xlinker --verbose -L/home/jlquinn/dmd2/linux/bin64/../lib64 -L/home/jlquinn/dmd2/linux/bin64/../lib32 -Xlinker --no-warn-search-mismatch -Xlinker --export-dynamic -l:libphobos2.a -lpthread -lm -lrt


jlquinn@wyvern:~/re/test$ ldd --version
ldd (Ubuntu EGLIBC 2.15-0ubuntu20.1) 2.15
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 11, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #24 from Jerry Quinn <jlquinn@optonline.net> 2013-06-11 13:10:56 PDT ---
Created an attachment (id=1225)
Program object file

output of dmd -c junk.d

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 11, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #25 from Martin Nowak <code@dawg.eu> 2013-06-11 13:35:58 PDT ---
(In reply to comment #23)
> I assume this is the linker script generated by dmd -v:
> 
No, it's part of the output when you pass --verbose to the linker.
When I compile dmd junk -L--verbose the linker output should contain them.

On my machine this looks like this.


GNU ld version 2.23.51.0.1-3.fc18 20120806
...
using internal linker script:
==================================================
...
==================================================
attempt to open /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crt1.o
succeeded
...

> jlquinn@wyvern:~/re/test$ ldd --version
The linker is usually called ld, ldd is a different tool.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 11, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #26 from Jerry Quinn <jlquinn@optonline.net> 2013-06-11 14:01:07 PDT ---
(In reply to comment #25)
> (In reply to comment #23)
> > I assume this is the linker script generated by dmd -v:
> > 
> No, it's part of the output when you pass --verbose to the linker.
> When I compile dmd junk -L--verbose the linker output should contain them.
> 
> On my machine this looks like this.
> 
> 
> GNU ld version 2.23.51.0.1-3.fc18 20120806
> ...
> using internal linker script:
> ==================================================
> ...
> ==================================================
> attempt to open /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crt1.o
> succeeded
> ...
> 
> > jlquinn@wyvern:~/re/test$ ldd --version
> The linker is usually called ld, ldd is a different tool.

oops:

jlquinn@wyvern:~/re/test$ ld --version
GNU gold (GNU Binutils for Ubuntu 2.22.90.20120924) 1.11
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.


OK, apparently it's a difference between gnu ld and gold.  There doesn't seem to be a linker script.  -L--verbose doesn't dump the script for gold:


jlquinn@wyvern:~/re/test$ /home/jlquinn/dmd2/linux/bin64/dmd junk.d
-L--debug=script
/usr/bin/ld: Dumping linker script
jlquinn@wyvern:~/re/test$

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274


Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #27 from Martin Nowak <code@dawg.eu> 2013-06-12 00:56:13 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2164

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #28 from github-bugzilla@puremagic.com 2013-06-12 16:21:51 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/b470799d2b250cd93953d92f101d8d5081f100a7 fix Issue 10274

- Elf64 uses only the explicit addends of a relocation.
  It seems like ld.bfd still adds the value at the to be
  relocated address, but ld.gold does not.

https://github.com/D-Programming-Language/dmd/commit/bd98b631fcb98700549a2f998f1be2086ce69d41 Merge pull request #2164 from dawgfoto/fix10724

fix Issue 10274 - DMD 2.063 produces broken binaries

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #29 from github-bugzilla@puremagic.com 2013-06-12 16:32:24 PDT ---
Commit pushed to 2.063 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/e123e4f3ac9daf6cca6138004727f21d42992ad1 Merge pull request #2164 from dawgfoto/fix10724

fix Issue 10274 - DMD 2.063 produces broken binaries

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------