This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: trouble building glibc-2.3.2/gcc-3.4.0/sparc64 with cvs binutils


On Sun, May 02, 2004 at 09:54:03PM -0700, Dan Kegel wrote:
> .../sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/libc.a(dl-reloc.o)(.text+0x4b4):
> In function `elf_machine_load_address.3':
> : undefined reference to `_DYNAMIC'
> collect2: ld returned 1 exit status
> make[2]: *** 
> [.../sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/sln] 
> Error 1
> 
> That _DYNAMIC symbol is defined in glibc's link.h along with this comment:
> 
> /* This symbol refers to the "dynamic structure" in the `.dynamic' section
>    of whatever module refers to `_DYNAMIC'.  So, to find its own
>    `struct r_debug', a program could do:
>      for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn)
>        if (dyn->d_tag == DT_DEBUG)
>          r_debug = (struct r_debug *) dyn->d_un.d_ptr;
>    */
> extern ElfW(Dyn) _DYNAMIC[];

This is a declaration, not definition.
_DYNAMIC is only used in elf_machine_load_address, which is static inline
function, but it is only used in rtld.c and nowhere else.
So, certainly it should not be used in dl-reloc.o.
If it does, it looks like a compiler problem.
Try adding __attribute__((always_inline)) to it to see if it helps, but
still I'd like to understand why elf_machine_load_address.3 is being emitted
into assembly in dl-reloc.s at all.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]