Subject: Re: Bogus variable in ld.elf_so
To: Bang Jun-Young <>
From: Matt Thomas <>
List: tech-toolchain
Date: 09/05/2002 09:55:36
At 09:47 AM 9/5/2002, Bang Jun-Young wrote:
>I don't understand this in ld.elf_so:
>                 tmp = (Elf_Addr)(defobj->relocbase + def->st_value);
>                 if (*where != tmp)
>                         *where = tmp;
>If *where is not same as tmp, value of tmp is assigned to *where and
>they have same value. If *where is same as tmp, they are still same.
>I can see there lots of unnecessary operations like above. Wouldn't
>it be made simpler like
>                 *where = (Elf_Addr)(defobj->relocbase + def->st_value);

No.  The point is to not force a copy-on-write fault if the contents
would be the same.

Matt Thomas               Internet:
3am Software Foundry      WWW URL:
Cupertino, CA             Disclaimer: I avow all knowledge of this message