This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports 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: static link on MIPS


On Wed, 24 Dec 2008 02:28:10 +0900 (JST), Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> Up to glibc 2.8, glibc-2.3.90-20050704-mips-dl-static.patch by Maciej
> could be used to fix the problem.  But with glibc 2.9, it causes
> segfaults.
> 
> Did someone already fixed this for recent glibc?
> 
> If no, I want to forward-port the patch.  Can anybody suggests where
> to fix?  I suppose the patch was broken since this commit
> (http://sourceware.org/ml/libc-ports/2008-10/msg00000.html), but not
> sure yet.

Sorry, this commit is irrelevant.  The mips-dl-static.patch was just
too old.

This code in _dl_static_init() should be updated to post glibc 2.4 (!)
while type of loadbase (lookup_t) is a poingter to struct link_map
rather than ElfW(Addr).

  for (scope = l->l_local_scope; *scope != NULL; scope++)
    for (i = 0; i < (*scope)->r_nlist; i++)
      if ((*scope)->r_list[i]->l_addr == loadbase)
        rtld_map = (*scope)->r_list[i];

This should be:

  for (scope = l->l_local_scope; *scope != NULL; scope++)
    for (i = 0; i < (*scope)->r_nlist; i++)
      if ((*scope)->r_list[i] == loadbase)
        rtld_map = (*scope)->r_list[i];

I'll post a replacement of the libc-port part of the patch in bugzilla.

---
Atsushi Nemoto


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