[OpenAFS-devel] subtle change needed for s390x

Carsten Jacobi jacobi@de.ibm.com
Mon, 13 Sep 2010 15:09:51 +0200


Hello,

I've tried to build OpenAFS-1.4.12 last week for Linux on s390x and
the build failed with this error:

`savecontext' referenced in section `.text'
of /usr/src/packages/BUILD/openafs-1.4.12/lib/liblwp.a(lwp.o): defined =
in
discarded section `.note.GNU-stack'
of /usr/src/packages/BUILD/openafs-1.4.12/lib/liblwp.a(process.o)

After some investigations I've found out that the ELF-Section
'.note.GNU-stack'
must not contain anything (size=3D0) but is meant as a notification to
activate
some special memory protection mechanisms against stack overflows or
something (I've found some details here:
http://www.gentoo.org/proj/en/hardened/gnu-stack.xml).

At the moment, the 'savecontext' label is placed into the '.note.GNU-st=
ack'
section (in the readelf output the section has a length of 0x90 bytes) =
and
it seems this section is removed somewhere with its contents thus causi=
ng
the above error.

Could you change the file src/lwp/process.s390x.s such that the marker
for the '.note.GNU-stack' is at the very end of that assembly source? I=
t
should be made sure that the symbol 'savecontext' won't be part of the
'.note.GNU-stack' sections as this is a notifier only and it seems some=

other "intelligent" tools just remove the section.
And it stroke me that the C-Compiler generates the .section statement
with the keyword @progbits instead of %progbits. After moving the .sect=
ion
statement to the bottom of the file and replacing the '%' character wit=
h
'@'
the code compiles through on Novell-SLES11.
                                                                       =
     
                                                                       =
     
                                                                       =
     
 Mit freundlichen Gr=FC=DFen / Kind regards                            =
         
                                                                       =
     
                                                                       =
     
                                                                       =
     
                                                                       =
     
 Carsten Jacobi                                                        =
     
                                                                       =
     
                                                                       =
     
                                                                       =
     
 Millicode Developer                                                   =
     
                                                                       =
     
 IBM Systems &Technology Group, Systems Software Development / FW Proce=
ssor 
 Firmware Entwicklung                                                  =
     
                                                                       =
     
 ----------------------------------------------------------------------=
---- 
 -----------------------------------------------------------------     =
     
                                                                       =
     
 IBM Deutschland                                                       =
     
                                                                       =
     
 Sch=F6naicher Str. 220                                                =
       
                                                                       =
     
 71032 B=F6blingen                                                     =
       
                                                                       =
     
 Phone: +49-7031-16-4468 (*120 4468)                                   =
     
                                                                       =
     
 E-Mail: jacobi@de.ibm.com                                             =
     
                                                                       =
     
 ----------------------------------------------------------------------=
---- 
 -----------------------------------------------------------------     =
     
                                                                       =
     
 IBM Deutschland Research & Development GmbH / Vorsitzender des        =
     
 Aufsichtsrats: Martin Jetter                                          =
     
 Gesch=E4ftsf=FChrung: Dirk Wittkopp                                   =
         
 Sitz der Gesellschaft: B=F6blingen / Registergericht: Amtsgericht Stut=
tgart, 
 HRB 243294                                                            =
     
                                                                       =
     
=