All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: linux-sh@vger.kernel.org
Subject: stack usage with libgcc math funcs
Date: Wed, 24 Dec 2008 17:13:04 +0000	[thread overview]
Message-ID: <200812241257.33701.vapier@gentoo.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]

i dont know superh assembly, so i cant really check the code myself.  starting 
with at gcc-4.1.2 (at least, gcc-3.4.6 doesnt seem to have this issue), a few 
objects in libgcc.a lack GNU-stack markings.  here is the scanelf output 
against libgcc.a from gcc-4.3.2.  basically, '!WX' just means that the objects 
do not have a .note.GNU-stack section.

$ scanelf -qeR .
!WX --- ---  ./4.3.2/_ashiftrt.o
!WX --- ---  ./4.3.2/_ashiftrt_n.o
!WX --- ---  ./4.3.2/_ashiftlt.o
!WX --- ---  ./4.3.2/_lshiftrt.o
!WX --- ---  ./4.3.2/_movmem.o
!WX --- ---  ./4.3.2/_movmem_i4.o
!WX --- ---  ./4.3.2/_mulsi3.o
!WX --- ---  ./4.3.2/_sdivsi3.o
!WX --- ---  ./4.3.2/_sdivsi3_i4.o
!WX --- ---  ./4.3.2/_udivsi3.o
!WX --- ---  ./4.3.2/_udivsi3_i4.o
!WX --- ---  ./4.3.2/_set_fpscr.o
!WX --- ---  ./4.3.2/_div_table.o
!WX --- ---  ./4.3.2/_udiv_qrnnd_16.o
!WX --- ---  ./4.3.2/_ic_invalidate.o
!WX --- ---  ./4.3.2/_ic_invalidate_array.o
!WX --- ---  ./4.3.2/linux-atomic.o

assuming libgcc doesnt actually use the stack to exec code, the attached patch 
should fix things i think.
-mike

--- gcc/config/sh/lib1funcs.asm
+++ gcc/config/sh/lib1funcs.asm
@@ -34,6 +34,11 @@
 !! recoded in assembly by Toshiyasu Morita
 !! tm@netcom.com
 
+#if defined(__ELF__) && defined(__linux__)
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
+
 /* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
    ELF local label prefixes by J"orn Rennecke
    amylaar@cygnus.com  */

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

             reply	other threads:[~2008-12-24 17:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-24 17:13 Mike Frysinger [this message]
2008-12-24 17:28 ` stack usage with libgcc math funcs Mike Frysinger
2008-12-24 22:57 ` Kaz Kojima
2008-12-25  0:15 ` Mike Frysinger
2008-12-25  1:22 ` Kaz Kojima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200812241257.33701.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.