public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* stack usage with libgcc math funcs
@ 2008-12-24 17:13 Mike Frysinger
  2008-12-24 17:28 ` Mike Frysinger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mike Frysinger @ 2008-12-24 17:13 UTC (permalink / raw)
  To: linux-sh

[-- 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 --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-25  1:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-24 17:13 stack usage with libgcc math funcs Mike Frysinger
2008-12-24 17:28 ` Mike Frysinger
2008-12-24 22:57 ` Kaz Kojima
2008-12-25  0:15 ` Mike Frysinger
2008-12-25  1:22 ` Kaz Kojima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox