bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/16886] New: setjmp/longjmp in libopcodes would be faster a


From: rsc at swtch dot com
Subject: [Bug binutils/16886] New: setjmp/longjmp in libopcodes would be faster as sigsetjmp w/ save=0
Date: Wed, 30 Apr 2014 11:41:44 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=16886

            Bug ID: 16886
           Summary: setjmp/longjmp in libopcodes would be faster as
                    sigsetjmp w/ save=0
           Product: binutils
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: rsc at swtch dot com

Created attachment 7568
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7568&action=edit
sample input for objdump

Running objdump -d -z on a large x86 ELF executable on OS X, I find that it
makes many sigaltstack and sigprocmask calls. These are caused by the use of
setjmp/longjmp inside the i386 disassembler, although the pattern is repeated
on other architectures.

The longjmp is not being made out of a signal handler, so it appears that it
would be safe to use sigsetjmp(x, 0) and siglongjmp, avoiding those system
calls.

Command: x86_64-linux-elf-objdump -d -z test.elf >/dev/null
Time Before: 4.78u 0.41s 5.20r
Time After: 4.25u 0.00s 4.26r 

I hacked up the comparison using #defines. I will leave a real fix to you.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]