www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4758] New: --gc-sections breaks exception handling on Linux

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4758

           Summary: --gc-sections breaks exception handling on Linux
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: nfxjfg gmail.com



$ cat exc.d
void main() {
    try {
        throw new Exception("muh");
    } catch (Exception e) {
    }
}

$ dmd exc.d -L--gc-sections -L--print-gc-sections 2>&1 |grep exc
/usr/bin/ld: Removing unused section '.deh_eh' in file 'exc.o'
/usr/bin/ld: Removing unused section '.tdata' in file 'exc.o'

$ ./exc
unhandled exception

This "unhandled exception" thing is printed when the D runtime (Tango; based on
Phobos1 runtime) doesn't find any exception records. It seems --gc-sections
removes all D sections (including the bottom most exception handler in the
runtime). It seems the linker removes all entries from section .deh_eh.

I wonder if this can be fixed. It works in g++.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 29 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4758


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |braddr puremagic.com
         Resolution|                            |DUPLICATE



---
*** This issue has been marked as a duplicate of issue 879 ***

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