December 10, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684



--- Comment #9 from Timothee Cour <timothee.cour2@gmail.com> 2013-12-09 16:36:23 PST ---
(In reply to comment #8)
> Interesting. The segfault is caused by stdout being null.  But std.stdio's
> static this() does initialize it correctly. So the static this() somehow isn't
> getting called by the druntime startup code???


$cat ./dmd/src/dmd.conf
[Environment]
DFLAGS=-Ipath/to/phobos -Ipath/to/druntime/import
-L-Lpath/to/phobos/generated/linux/release/default/ -L--export-dynamic -L-lrt


> What compile flags are you using, and what's the contents of dmd.conf?

#compile flags:
$./dmd/src/dmd -g -ofmain main.d

Other than that I'm building dmd/druntime/phobos as usual, no special options etc.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684


Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P4                          |P5
         AssignedTo|nobody@puremagic.com        |code@dawg.eu


--- Comment #10 from Martin Nowak <code@dawg.eu> 2013-12-22 01:01:37 PST ---
Just ran into this while preparing the release on a Ubuntu 12.04 box.
The .ctors .dtors sections of the object files are truncated, they are 4 byte
each, but they should be 8 byte for the 64-bit pointer.
This is not an ld.gold issue, still investigating.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684



--- Comment #11 from Martin Nowak <code@dawg.eu> 2013-12-22 01:27:51 PST ---
Seems like changing the relocation at this line fixes the problem. https://github.com/D-Programming-Language/dmd/blob/2a589a19cbd7e95880653043ebb556bf214b8340/src/backend/elfobj.c#L3436

`reltype = (config.flags3 & CFG3pic) ? R_X86_64_64 : R_X86_64_32;`

always use R_X86_64_64

`reltype = R_X86_64_64;`

I'll still have to see why this didn't fail on other platforms. Probably because the section itself is NPTRSIZE aligned?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684



--- Comment #12 from Martin Nowak <code@dawg.eu> 2013-12-22 10:12:53 PST ---
This was introduced with https://github.com/D-Programming-Language/dmd/commit/0cba87c6330cd7853139f51448c0f98372fb76d7.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684


Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, wrong-code
            Summary|SIGSEGV,                    |SIGSEGV with ld.bfd version
                   |std.stdio.__T7writelnTAyaZ. |2.22
                   |writeln()  at               |
                   |std/stdio.d:1906            |


--- Comment #13 from Martin Nowak <code@dawg.eu> 2013-12-22 11:26:45 PST ---
https://github.com/D-Programming-Language/dmd/pull/3011

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684



--- Comment #14 from github-bugzilla@puremagic.com 2013-12-22 13:11:12 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/8dce20837d4ae909ac98bc21354a7ba2d86cf902 fix Issue 11684 - SIGSEGV with ld.bfd version 2.22

- Don't use zero extended relocations in data segment,
  because we need to write out the whole 8-byte address.

- Data relocations don't depend on PIC.

- This regression was introduced with
  0cba87c6330cd7853139f51448c0f98372fb76d7.
  Before this commit the code still wrote out
  an 8-byte address, so the zero extension worked
  happened to work for <4GB binaries.

https://github.com/D-Programming-Language/dmd/commit/e8d0efc8ea7c2fe35f859dd5dce486b5361ae1ed Merge pull request #3011 from MartinNowak/fix11684

[2.065,Reg] fix Issue 11684 - SIGSEGV with ld.bfd version 2.22

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684



--- Comment #15 from github-bugzilla@puremagic.com 2013-12-22 13:25:19 PST ---
Commit pushed to 2.065 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3f3a526c00cb6d41b92d2ca4bbf0d22f90a697f6 Merge pull request #3011 from MartinNowak/fix11684

[2.065,Reg] fix Issue 11684 - SIGSEGV with ld.bfd version 2.22

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684



--- Comment #16 from github-bugzilla@puremagic.com 2013-12-22 13:29:20 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c1f3cc76d82eee65f403347852a03a6bd2c1b605 Merge pull request #3011 from MartinNowak/fix11684

[2.065,Reg] fix Issue 11684 - SIGSEGV with ld.bfd version 2.22

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684


Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11684



--- Comment #17 from Timothee Cour <timothee.cour2@gmail.com> 2013-12-22 13:41:28 PST ---
(In reply to comment #16)
> Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd
> 
> https://github.com/D-Programming-Language/dmd/commit/c1f3cc76d82eee65f403347852a03a6bd2c1b605 Merge pull request #3011 from MartinNowak/fix11684
> 
> [2.065,Reg] fix Issue 11684 - SIGSEGV with ld.bfd version 2.22

how come this wasn't auto-detected by the auto tester? isn't ubuntu part of the machines being tested?

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