bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Undefined reference to init/fini array symbols


From: Kristian Van Der Vliet
Subject: Re: Undefined reference to init/fini array symbols
Date: Sun, 25 Jan 2004 12:56:40 +0000
User-agent: KMail/1.5.3

On Sunday 25 January 2004 11:33 am, Kristian Van Der Vliet wrote:
> On Saturday 24 January 2004 2:59 am, Pragnesh Sampat wrote:
>> On Fri, 2004-01-23 at 16:07, Kristian Van Der Vliet wrote:
>>> Apologies for the crosspost to both Glibc & Binutils lists.  I am
>>> currently porting Glibc 2.3.2 to Syllable (See sig) and have the
>>> codebase upto the stage where it attempts to link libc_pic.a  This
>>> currently fails with the following errors:
>>>
>>> ..
>>> /home/user/glibc-configure/libc_pic.os(.text+0x596): In function
>>> `__libc_csu_init':
>>> /home/user/glibc-2.3.2/csu/elf-init.c:54: undefined reference to
>>> `__preinit_array_end'
>>
>> Did you try --enable-initfini-array option to gcc configure?  I kind of
>> remember needing it, but don't recall what exact failures I got.  Don't
>> know much about the option though, so I could be off base here.
>>
>> -Pragnesh
>
> My understanding is that --enable-initfini-array enables the use of
> init/fini_array within GCC itself but does not effect code generation.
> Certainly neither the copy of Gcc I am using on Linux nor on Syllable were
> configured with --enable-initfini-array.  The problem is that both the GCC
> configure test for init_array & test code I detailed in the last email both
> work fine, so init_array/fini_array etc. are available and work under
> normally work as I would expect; it is just when linking Glibc 2.3.2 that
> it fails.

O.K, I can narrow down the question a little now.  On further investigation, 
libc.so.lds contains:

. = ALIGN(32 / 8);
  .preinit_array     : { *(.preinit_array) }
  .init_array     : { *(.init_array) }
  .fini_array     : { *(.fini_array) }

instead of

. = ALIGN(32 / 8);
  PROVIDE (__preinit_array_start = .);
  .preinit_array     : { *(.preinit_array) }
  PROVIDE (__preinit_array_end = .);
  PROVIDE (__init_array_start = .);
  .init_array     : { *(.init_array) }
  PROVIDE (__init_array_end = .);
  PROVIDE (__fini_array_start = .);
  .fini_array     : { *(.fini_array) }
  PROVIDE (__fini_array_end = .);

Modifying libc.so.lds myself and adding the PROVIDEs and re-building works 
perfectly.  Is there any particular reason why the linker script is missing 
those PROVIDEs?  Is this a known issue?  Failing that can someone point out 
where libc.so.lds is generated?

-- 
Vanders
http://syllable.sourceforge.net/
http://www.liqwyd.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]