Problem with __GI_errno_location and _h__errno_location alias names

stl st.lambert02 at gmail.com
Thu Jan 19 15:46:14 UTC 2012


Thanks for your answers!

> Do you mean architecture as in ARM, MIPS, etc. or just new board?
I mean a new processor.

> If you're doing a new port, why do you use an ancient kernel?
My linux port is not completed yet. I am at the stage of romfs mounting, however
I can't do anything more before have build a whole linux system
(kernel, filesystem, user apps, ...)
It is for that reason that I have built my cross-compiler linked against uClibc.
I am "testing" on an old uClinux port, but the Linux version I am
porting is a recent one.

> From the nm man page:
>
>           "w" The symbol is a weak symbol that has not been specifically
>               tagged as a weak object symbol.  When a weak defined symbol is
>               linked with a normal defined symbol, the normal defined symbol
>               is used with no error.  When a weak undefined symbol is linked
>               and the symbol is not defined, the value of the symbol is
>               determined in a system-specific manner without error.  On some
>               systems, uppercase indicates that a default value has been
>               specified.
I precise that the executable is converted to FLAT with elf2flt,
because uClinux only run FLAT binaries.
When the executable is handled by elf2flt, the relocations for these
symbols are discarded because of
*UND* section type. When the uclinux flat loader (binfmt_flat.c) load
the executable before running it,
the relocation are computed, except for these symbols. This leaves
instructions in an unexecutable way..
Unfortunately, I haven't any other way to test it at the moment.

> For static libs the __GI__ aliases are not useful (if my understanding
> is correct), but they shouldn't cause harm.
Ok. How could I configure to avoid __GI_ aliases?
I have already disable shared support:
ARCH_HAS_NO_SHARED=y
ARCH_HAS_NO_LDSO=y


> so the symbols are weak.  It looks like your libc does not define these symbols?
Yes, as I said, it seems that alias symbols are defined
(__GI_errno_location..) while
uClibc_main() expects non-aliased symbols (__errno_location..)


Here is a "objdump -t __errno_location.o"  :

SYMBOL TABLE:
00000000 l    df *ABS*  00000000 __errno_location.c
00000000 l    d  .text  00000000 .text
00000000 l    d  .data  00000000 .data
00000000 l    d  .bss   00000000 .bss
00000000 l    d  .text.__GI___errno_location    00000000
.text.__GI___errno_location
00000000 l    d  .debug_frame   00000000 .debug_frame
00000000 l       .debug_frame   00000000 .Lframe0
00000000 l       .text.__GI___errno_location    00000000 .LFB3
00000000 l    d  .sbss  00000000 .sbss
00000000 l    d  .comment       00000000 .comment
00000000  w    F .text.__GI___errno_location    0000000a .hidden
__GI___errno_location
00000000         *UND*  00000000 errno
00000000  w    F .text.__GI___errno_location    0000000a __errno_location

Aliased symbols have .hidden attribute.
Could this be a source of my problem?


More information about the uClibc mailing list