This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ports/2682] New: On ARM EABI, exit should be marked EXIDX_CANTUNWIND


On ARM EABI, the function "exit" needs to be marked with EXIDX_CANTUNWIND so
that exceptions thrown from functions registered with atexit properly stop
unwinding at that point.

This may need a GCC change to add a "nounwind" attribute so that C functions can
be marked that way.  (_start is defined in assembly with ".cantunwind" which
deals with the true end of the stack, but that doesn't suffice; the C++ standard
requires unwinding to stop and terminate to be called on leaving an atexit
function.)

The C++ testcase is as follows; it should call "terminate" but instead segfaults.

extern "C" int puts(const char *);

struct S
{
  int i;
  S() : i(0) { }
  ~S()
  {
    puts("dtor");
    throw "s";  // no handler anywhere
  }
};

S xo;

int main(int argc, char *argv[])
{
  puts("main");
  return 0;
}

-- 
           Summary: On ARM EABI, exit should be marked EXIDX_CANTUNWIND
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ports
        AssignedTo: roland at gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org
                CC: glibc-bugs at sources dot redhat dot com
GCC target triplet: arm-*-linux-gnueabi


http://sourceware.org/bugzilla/show_bug.cgi?id=2682

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]