RFA: Support STT_COMMON symbol type in dynamic loader
Jeff Johnston
jjohnstn@redhat.com
Wed Oct 10 18:26:00 GMT 2007
Ok Nick, please go ahead.
-- Jeff J.
Nick Clifton wrote:
> Hi Jeff,
>
> I would like to copy a recent glibc fix (for PR 5104, which also
> references the binutils PR 4799) into newlib. It allows the dynamic
> loader to support symbols with the STT_COMMON type. The linker does
> not currently produce such symbols, but it may do in the future and
> it would be helpful if the dynamic loader supported them.
>
> Cheers
> Nick
>
> newlib/ChangeLog
> 2007-10-08 Nick Clifton <nickc@redhat.com>
>
> * libc/sys/linux/dl/do-lookup.h (FCT): Support symbols with
> the STT_COMMON type.
>
> Index: libc/sys/linux/dl/do-lookup.h
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/sys/linux/dl/do-lookup.h,v
> retrieving revision 1.1
> diff -c -3 -p -r1.1 do-lookup.h
> *** libc/sys/linux/dl/do-lookup.h 28 May 2003 22:04:34 -0000 1.1
> --- libc/sys/linux/dl/do-lookup.h 8 Oct 2007 08:28:20 -0000
> *************** FCT (const char *undef_name, unsigned lo
> *** 83,91 ****
> (type_class & (sym->st_shndx == SHN_UNDEF)))
> continue;
>
> ! if (ELFW(ST_TYPE) (sym->st_info) > STT_FUNC)
> ! /* Ignore all but STT_NOTYPE, STT_OBJECT and STT_FUNC entries
> ! since these are no code/data definitions. */
> continue;
>
> if (sym != ref && strcmp (strtab + sym->st_name, undef_name))
> --- 83,92 ----
> (type_class & (sym->st_shndx == SHN_UNDEF)))
> continue;
>
> ! if (ELFW(ST_TYPE) (sym->st_info) > STT_FUNC
> ! && ELFW(ST_TYPE) (sym->st_info) != STT_COMMON)
> ! /* Ignore all but STT_NOTYPE, STT_OBJECT, STT_COMMON and
> ! STT_FUNC entries since these are no code/data definitions. */
> continue;
>
> if (sym != ref && strcmp (strtab + sym->st_name, undef_name))
More information about the Newlib
mailing list