[K42-discussion] static_buf in gentmp

Donour Sizemore donour at cs.unm.edu
Tue Jan 9 05:48:19 EST 2007


Donour Sizemore wrote:
> I'm getting linking errors like this:
> 
> --
> 
> ServerFileBlockNFS.o:(.toc1+0x4b0): undefined reference to 
> `TplMetaVAPageServer<ServerFileBlockNFS>::static_buf'
> ServerFileBlockK42RamFS.o:(.toc1+0x3d8): undefined reference to 
> `TplMetaPAPageServer<ServerFileBlockK42RamFS>::static_buf'
> ServerFileBlockKFS.o:(.toc1+0x2d8): undefined reference to 
> `TplMetaPAPageServer<ServerFileBlockKFS>::static_buf'
> /home/donour/git/install/lib/powerpc/fullDeb/libfs.a(PagingTransportPA.o):(.toc1+0x150): 
> undefined reference to `TplMetaPAPageServer<PagingTransportPA>::static_buf'
> /home/donour/git/install/lib/powerpc/fullDeb/libfs.a(PagingTransportVA.o):(.toc1+0x150): 
> undefined reference to `TplMetaVAPageServer<PagingTransportVA>::static_buf'
> --
> 
> That seem to be coming from the code created from gentmp.awk.
> 
> -- gentmp.awk --
> function createStandardFunc()
> {
>    ...
>   
>   printf("template<> char 
> %s<INSTNAME>::static_buf[sizeof(%s<INSTNAME>)]\n",TMclass,TMclass)              
>  > XF;
>   
>    ...
> --
> 
> 
> Does anybody know what the purpose of the static_buf member?
> 
> thanks
> 

Looking at this further. gcc3 sticks this buffer into the object files 
as a common, 'C', symbol. However gcc4 just generates the reference 
symbol (in our case an undefined reference) when the object is used. 
Does anybody know why this behavior should be different?

donour




More information about the K42-discussion mailing list