64-bit PowerPC and small data area?

Sebastian Huber sebastian.huber@embedded-brains.de
Tue Jul 25 15:40:00 GMT 2017


Hello,

in the PowerPC ELFv2 specification

https://members.openpowerfoundation.org/document/dl/576

we have

"3.4.2 Use of the Small Data Area

For a data item in the .sdata or .sbss sections, a compiler may generate 
short-form one-instruction refer-
ences. In an executable file or shared library, such a reference is 
relative to the address of the TOC base
symbol (which can be obtained from r2 if a TOC pointer is initialized). 
A compiler that generates code using
the small data area should provide an option to select the maximum size 
of objects placed in the small data
area, and a means of disabling any use of the small data area. When 
generating code for ELF shared
libraries, the small data area should not be used for default-visibility 
global objects. This is to satisfy ELF
shared-library symbol interposition rules. That is, an ordinary global 
symbol in a shared library may be over-
ridden by a symbol of the same name defined in the executable or another 
shared library. Supporting interpo-
sition when using TOC-pointer relative addressing would require text 
relocations."

I tried to generate code using the small data area on a 64-bit PowerPC 
GCC, but I was not successful. We have in the GCC sources 
(gcc/config/rs6000/rs6000.c):

/* Return 1 for an operand in small memory on V.4/eabi.  */

int
small_data_operand (rtx op ATTRIBUTE_UNUSED,
             machine_mode mode ATTRIBUTE_UNUSED)
{
#if TARGET_ELF
   rtx sym_ref;

   if (rs6000_sdata == SDATA_NONE || rs6000_sdata == SDATA_DATA)
     return 0;

   if (DEFAULT_ABI != ABI_V4)
     return 0;

So, it looks like the small data stuff is not support for ABI_ELFv2? Are 
there main issues with the small data area using ELVv2 or is this simply 
not implemented due to a lack of interested?


-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the Gcc mailing list