[ccan] autodata problem

PICCA Frédéric-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Sat Mar 16 04:59:29 EST 2013


so I can confirm that I need to add the -ggdb CFLAGS AND replace autodata with xautodata to be able to compile
my project.

picca at mordor:~/Projets/hkl/hkl/.libs$ readelf -a libhkl.so | grep autodata
  [25] xautodata_geometr PROGBITS        00044630 044630 000030 00  WA  0   0  4
   01     .init_array .fini_array .jcr .data.rel.ro .dynamic .got .got.plt .data xautodata_geometries .bss 
00043508  00011f06 R_386_GLOB_DAT    00044660   __stop_xautodata_geome
0004354c  00006206 R_386_GLOB_DAT    00044630   __start_xautodata_geom
000437d0  0000d907 R_386_JUMP_SLOT   0002bc20   autodata_get_section
    98: 00044630     0 NOTYPE  GLOBAL DEFAULT  ABS __start_xautodata_geometr
   103: 0002bc3e     5 FUNC    GLOBAL DEFAULT   12 autodata_free
   217: 0002bc20    30 FUNC    GLOBAL DEFAULT   12 autodata_get_section
   287: 00044660     0 NOTYPE  GLOBAL DEFAULT  ABS __stop_xautodata_geometri
   116: 00044630     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_39
   118: 00044634     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_46
   120: 00044638     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_53
   122: 0004463c     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_61
   124: 00044640     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_68
   126: 00044644     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_75
   128: 00044648     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_82
   130: 0004464c     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_89
   132: 00044650     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_96
   134: 00044654     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_103
   136: 00044658     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_110
   138: 0004465c     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_117
  1464: 00000000     0 FILE    LOCAL  DEFAULT  ABS autodata.c
  1538: 00044660     0 NOTYPE  GLOBAL DEFAULT  ABS __stop_xautodata_geometri
  1705: 0002bc20    30 FUNC    GLOBAL DEFAULT   12 autodata_get_section
  1709: 00044630     0 NOTYPE  GLOBAL DEFAULT  ABS __start_xautodata_geometr
  1783: 0002bc3e     5 FUNC    GLOBAL DEFAULT   12 autodata_free

So the __start/__stop are GLOBAL

Now I need to check if once stripped the autodata magic is still alive :).

picca at mordor:~/Projets/hkl/hkl/.libs$ readelf -a libhkl.so | grep autodata
  [25] xautodata_geometr PROGBITS        00044630 044630 000030 00  WA  0   0  4
   01     .init_array .fini_array .jcr .data.rel.ro .dynamic .got .got.plt .data xautodata_geometries .bss 
00043508  00011f06 R_386_GLOB_DAT    00044660   __stop_xautodata_geome
0004354c  00006206 R_386_GLOB_DAT    00044630   __start_xautodata_geom
000437d0  0000d907 R_386_JUMP_SLOT   0002bc20   autodata_get_section
    98: 00044630     0 NOTYPE  GLOBAL DEFAULT  ABS __start_xautodata_geometr
   103: 0002bc3e     5 FUNC    GLOBAL DEFAULT   12 autodata_free
   217: 0002bc20    30 FUNC    GLOBAL DEFAULT   12 autodata_get_section
   287: 00044660     0 NOTYPE  GLOBAL DEFAULT  ABS __stop_xautodata_geometri

so it seems that is ok

Do you know if this -ggdb can be replace by another option less invasive that -ggdb.
My program is so slow with this flags...
I usually use -O2 but I should try with -O0 to see what's going one.


with -O0

picca at mordor:~/Projets/hkl/hkl/.libs$ readelf -s libhkl.so | grep autodata
    98: 00044630     0 NOTYPE  GLOBAL DEFAULT  ABS __start_xautodata_geometr
   103: 0002bc3e     5 FUNC    GLOBAL DEFAULT   12 autodata_free
   217: 0002bc20    30 FUNC    GLOBAL DEFAULT   12 autodata_get_section
   287: 00044660     0 NOTYPE  GLOBAL DEFAULT  ABS __stop_xautodata_geometri
   109: 00044630     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_39
   111: 00044634     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_46
   113: 00044638     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_53
   115: 0004463c     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_61
   117: 00044640     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_68
   119: 00044644     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_75
   121: 00044648     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_82
   123: 0004464c     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_89
   125: 00044650     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_96
   127: 00044654     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_103
   129: 00044658     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_110
   131: 0004465c     4 OBJECT  LOCAL  DEFAULT   25 autodata_geometries_117
  1457: 00000000     0 FILE    LOCAL  DEFAULT  ABS autodata.c
  1531: 00044660     0 NOTYPE  GLOBAL DEFAULT  ABS __stop_xautodata_geometri
  1698: 0002bc20    30 FUNC    GLOBAL DEFAULT   12 autodata_get_section
  1702: 00044630     0 NOTYPE  GLOBAL DEFAULT  ABS __start_xautodata_geometr
  1776: 0002bc3e     5 FUNC    GLOBAL DEFAULT   12 autodata_free

with -O2

picca at mordor:~/Projets/hkl/hkl/.libs$ readelf -s libhkl.so | grep autodata
    17: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __stop_xautodata_geometri
    56: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __start_xautodata_geometr
   105: 000201f0     2 FUNC    GLOBAL DEFAULT   12 autodata_free
   219: 000201d0    20 FUNC    GLOBAL DEFAULT   12 autodata_get_section
   764: 00000000     0 FILE    LOCAL  DEFAULT  ABS autodata.c
   838: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __stop_xautodata_geometri
  1005: 000201d0    20 FUNC    GLOBAL DEFAULT   12 autodata_get_section
  1009: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __start_xautodata_geometr
  1083: 000201f0     2 FUNC    GLOBAL DEFAULT   12 autodata_free

Now __start/__stop seems to be undefined...
so your implementation of autodata does not survive to the gcc optimisation.

do you know if we can use some magical attribute to avoid this problem ?

I saw also that all other section start with a '.', why not doing the same with autodata ?

Cheers

Frederic.


More information about the ccan mailing list