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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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: new syscall stub support for ia64 libc


On Thu, Nov 13, 2003 at 01:34:13PM -0800, David Mosberger wrote:
> --- elf/rtld.c
> +++ elf/rtld.c
> @@ -1169,7 +1169,7 @@
>  		  l->l_ldnum = ph->p_memsz / sizeof (ElfW(Dyn));
>  		  break;
>  		}
> -	      if (ph->p_type == PT_LOAD)
> +	      if (i == 0 && ph->p_type == PT_LOAD)
>  		assert ((void *) ph->p_vaddr == GL(dl_sysinfo_dso));
>  	    }
>  	  elf_get_dynamic_info (l, dyn_temp);

Shouldn't this be:

+#ifndef NDEBUG
+	  uint_fast16_t pt_load_num = 0;
+#endif
          for (uint_fast16_t i = 0; i < l->l_phnum; ++i)
            {
              const ElfW(Phdr) *const ph = &l->l_phdr[i];
              if (ph->p_type == PT_DYNAMIC)
                {
                  l->l_ld = (void *) ph->p_vaddr;
                  l->l_ldnum = ph->p_memsz / sizeof (ElfW(Dyn));
                  break;
                }
+#ifndef NDEBUG
              if (ph->p_type == PT_LOAD)
-		assert ((void *) ph->p_vaddr == GL(dl_sysinfo_dso));
+		{
+		  assert (pt_load_num
+			  || (void *) ph->p_vaddr == GL(dl_sysinfo_dso));
+		  pt_load_num++;
+		}
+#endif
            }

?

	Jakub


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