From maxim@codesourcery.com Tue Apr 10 19:28:00 2012 From: maxim@codesourcery.com (Maxim Kuvyrkov) Date: Tue, 10 Apr 2012 19:28:00 -0000 Subject: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch Message-ID: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> Mark, This patch makes rtld emulator in cross prelink use ld.so's name as it is encoded in PT_INTERP header. Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's name, but the linker actually expects "/lib/ld.so.1" -- that one slash at the beginning causes prelink checks done by the runtime linker to fail and not use prelink information. The runtime linker sets up a map for itself under the name stored in PT_INTERP header of the executable, and this patch makes rtld emulator follow the suit. I have tested this patch using a different version of rtld emulator (the one that CodeSourcery / Mentor maintains), but the function in question is the same in both, so this patch is also relevant for Yocto's prelink. Any comments? Please merge at your leisure. Thank you, -- Maxim Kuvyrkov CodeSourcery / Mentor Graphics -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch Type: application/octet-stream Size: 2286 bytes Desc: not available URL: -------------- next part -------------- From mark.hatle@windriver.com Tue Apr 10 19:46:00 2012 From: mark.hatle@windriver.com (Mark Hatle) Date: Tue, 10 Apr 2012 19:46:00 -0000 Subject: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch In-Reply-To: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> Message-ID: <4F848E15.1030905@windriver.com> On 4/10/12 2:27 PM, Maxim Kuvyrkov wrote: > Mark, > > This patch makes rtld emulator in cross prelink use ld.so's name as it is encoded in PT_INTERP header. > > Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's name, but the linker actually expects "/lib/ld.so.1" -- that one slash at the beginning causes prelink checks done by the runtime linker to fail and not use prelink information. > > The runtime linker sets up a map for itself under the name stored in PT_INTERP header of the executable, and this patch makes rtld emulator follow the suit. > > I have tested this patch using a different version of rtld emulator (the one that CodeSourcery / Mentor maintains), but the function in question is the same in both, so this patch is also relevant for Yocto's prelink. > > Any comments? Please merge at your leisure. prelinker currently checks that the ld.so name matches what it's expecting for any given arch in the PL_ARCH structure. Does this change any of that behavior? Or does it simply change the internal prelink-rtld behavior so that it the prelink-rtld acts as if it's name is the PT_INTERP element? --Mark From maxim@codesourcery.com Tue Apr 10 19:57:00 2012 From: maxim@codesourcery.com (Maxim Kuvyrkov) Date: Tue, 10 Apr 2012 19:57:00 -0000 Subject: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch In-Reply-To: <4F848E15.1030905@windriver.com> References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> <4F848E15.1030905@windriver.com> Message-ID: <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> On 11/04/2012, at 7:46 AM, Mark Hatle wrote: > On 4/10/12 2:27 PM, Maxim Kuvyrkov wrote: >> Mark, >> >> This patch makes rtld emulator in cross prelink use ld.so's name as it is encoded in PT_INTERP header. >> >> Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's name, but the linker actually expects "/lib/ld.so.1" -- that one slash at the beginning causes prelink checks done by the runtime linker to fail and not use prelink information. >> >> The runtime linker sets up a map for itself under the name stored in PT_INTERP header of the executable, and this patch makes rtld emulator follow the suit. >> >> I have tested this patch using a different version of rtld emulator (the one that CodeSourcery / Mentor maintains), but the function in question is the same in both, so this patch is also relevant for Yocto's prelink. >> >> Any comments? Please merge at your leisure. > > prelinker currently checks that the ld.so name matches what it's expecting for any given arch in the PL_ARCH structure. Does this change any of that behavior? Or does it simply change the internal prelink-rtld behavior so that it the prelink-rtld acts as if it's name is the PT_INTERP element? It is the latter. Only behavior of prelink-rtld is change to the effect that it outputs "/lib/ld.so.1 -> /lib/ld.so.1 ..." as executable's dependency. Forgot to mention: the dependency on ld.so.1 [usually] comes from libdl.so, which is, probably, why this bug wasn't noticed before. -- Maxim Kuvyrkov CodeSourcery / Mentor Graphics From mark.hatle@windriver.com Tue Apr 10 20:23:00 2012 From: mark.hatle@windriver.com (Mark Hatle) Date: Tue, 10 Apr 2012 20:23:00 -0000 Subject: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch In-Reply-To: <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> <4F848E15.1030905@windriver.com> <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> Message-ID: <4F8496BA.3010706@windriver.com> On 4/10/12 2:56 PM, Maxim Kuvyrkov wrote: > On 11/04/2012, at 7:46 AM, Mark Hatle wrote: > >> On 4/10/12 2:27 PM, Maxim Kuvyrkov wrote: >>> Mark, >>> >>> This patch makes rtld emulator in cross prelink use ld.so's name as it is encoded in PT_INTERP header. >>> >>> Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's name, but the linker actually expects "/lib/ld.so.1" -- that one slash at the beginning causes prelink checks done by the runtime linker to fail and not use prelink information. >>> >>> The runtime linker sets up a map for itself under the name stored in PT_INTERP header of the executable, and this patch makes rtld emulator follow the suit. >>> >>> I have tested this patch using a different version of rtld emulator (the one that CodeSourcery / Mentor maintains), but the function in question is the same in both, so this patch is also relevant for Yocto's prelink. >>> >>> Any comments? Please merge at your leisure. >> >> prelinker currently checks that the ld.so name matches what it's expecting for any given arch in the PL_ARCH structure. Does this change any of that behavior? Or does it simply change the internal prelink-rtld behavior so that it the prelink-rtld acts as if it's name is the PT_INTERP element? > > It is the latter. Only behavior of prelink-rtld is change to the effect that it outputs "/lib/ld.so.1 -> /lib/ld.so.1 ..." as executable's dependency. > > Forgot to mention: the dependency on ld.so.1 [usually] comes from libdl.so, which is, probably, why this bug wasn't noticed before. Thanks, I think I understand what is going on now. I'll look into getting this merged into the cross prelinker later today or tomorrow. --Mark > -- > Maxim Kuvyrkov > CodeSourcery / Mentor Graphics > From maxim@codesourcery.com Sat May 26 03:42:00 2012 From: maxim@codesourcery.com (Maxim Kuvyrkov) Date: Sat, 26 May 2012 03:42:00 -0000 Subject: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch In-Reply-To: <4F8496BA.3010706@windriver.com> References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> <4F848E15.1030905@windriver.com> <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> <4F8496BA.3010706@windriver.com> Message-ID: <10862750-7E5E-4B2C-9FEF-1EADEB197044@codesourcery.com> On 11/04/2012, at 8:23 AM, Mark Hatle wrote: > On 4/10/12 2:56 PM, Maxim Kuvyrkov wrote: >> On 11/04/2012, at 7:46 AM, Mark Hatle wrote: >> >>> On 4/10/12 2:27 PM, Maxim Kuvyrkov wrote: >>>> Mark, >>>> >>>> This patch makes rtld emulator in cross prelink use ld.so's name as it is encoded in PT_INTERP header. >>>> >>>> Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's name, but the linker actually expects "/lib/ld.so.1" -- that one slash at the beginning causes prelink checks done by the runtime linker to fail and not use prelink information. >>>> >>>> The runtime linker sets up a map for itself under the name stored in PT_INTERP header of the executable, and this patch makes rtld emulator follow the suit. >>>> >>>> I have tested this patch using a different version of rtld emulator (the one that CodeSourcery / Mentor maintains), but the function in question is the same in both, so this patch is also relevant for Yocto's prelink. >>>> >>>> Any comments? Please merge at your leisure. >>> >>> prelinker currently checks that the ld.so name matches what it's expecting for any given arch in the PL_ARCH structure. Does this change any of that behavior? Or does it simply change the internal prelink-rtld behavior so that it the prelink-rtld acts as if it's name is the PT_INTERP element? >> >> It is the latter. Only behavior of prelink-rtld is change to the effect that it outputs "/lib/ld.so.1 -> /lib/ld.so.1 ..." as executable's dependency. >> >> Forgot to mention: the dependency on ld.so.1 [usually] comes from libdl.so, which is, probably, why this bug wasn't noticed before. > > Thanks, I think I understand what is going on now. I'll look into getting this merged into the cross prelinker later today or tomorrow. Mark, This patch is still not merged to cross-prelink, did you encounter a problem with it? Thank you, -- Maxim Kuvyrkov CodeSourcery / Mentor Graphics From mark.hatle@windriver.com Tue May 29 15:17:00 2012 From: mark.hatle@windriver.com (Mark Hatle) Date: Tue, 29 May 2012 15:17:00 -0000 Subject: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch In-Reply-To: <10862750-7E5E-4B2C-9FEF-1EADEB197044@codesourcery.com> References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> <4F848E15.1030905@windriver.com> <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> <4F8496BA.3010706@windriver.com> <10862750-7E5E-4B2C-9FEF-1EADEB197044@codesourcery.com> Message-ID: <4FC4E890.5010307@windriver.com> This was just an oversight it appears. I'm working on a number of merges into the cross prelinker today. Hopefully in a few days it will be tested and pushed. If you don't see anything, feel free to keep reminding me. --Mark On 5/25/12 10:42 PM, Maxim Kuvyrkov wrote: > On 11/04/2012, at 8:23 AM, Mark Hatle wrote: > >> On 4/10/12 2:56 PM, Maxim Kuvyrkov wrote: >>> On 11/04/2012, at 7:46 AM, Mark Hatle wrote: >>> >>>> On 4/10/12 2:27 PM, Maxim Kuvyrkov wrote: >>>>> Mark, >>>>> >>>>> This patch makes rtld emulator in cross prelink use ld.so's name as it is encoded in PT_INTERP header. >>>>> >>>>> Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's name, but the linker actually expects "/lib/ld.so.1" -- that one slash at the beginning causes prelink checks done by the runtime linker to fail and not use prelink information. >>>>> >>>>> The runtime linker sets up a map for itself under the name stored in PT_INTERP header of the executable, and this patch makes rtld emulator follow the suit. >>>>> >>>>> I have tested this patch using a different version of rtld emulator (the one that CodeSourcery / Mentor maintains), but the function in question is the same in both, so this patch is also relevant for Yocto's prelink. >>>>> >>>>> Any comments? Please merge at your leisure. >>>> >>>> prelinker currently checks that the ld.so name matches what it's expecting for any given arch in the PL_ARCH structure. Does this change any of that behavior? Or does it simply change the internal prelink-rtld behavior so that it the prelink-rtld acts as if it's name is the PT_INTERP element? >>> >>> It is the latter. Only behavior of prelink-rtld is change to the effect that it outputs "/lib/ld.so.1 -> /lib/ld.so.1 ..." as executable's dependency. >>> >>> Forgot to mention: the dependency on ld.so.1 [usually] comes from libdl.so, which is, probably, why this bug wasn't noticed before. >> >> Thanks, I think I understand what is going on now. I'll look into getting this merged into the cross prelinker later today or tomorrow. > > Mark, > > This patch is still not merged to cross-prelink, did you encounter a problem with it? > > Thank you, > > -- > Maxim Kuvyrkov > CodeSourcery / Mentor Graphics From maxim@codesourcery.com Wed Jun 27 22:34:00 2012 From: maxim@codesourcery.com (Maxim Kuvyrkov) Date: Wed, 27 Jun 2012 22:34:00 -0000 Subject: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch In-Reply-To: <4FC4E890.5010307@windriver.com> References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> <4F848E15.1030905@windriver.com> <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> <4F8496BA.3010706@windriver.com> <10862750-7E5E-4B2C-9FEF-1EADEB197044@codesourcery.com> <4FC4E890.5010307@windriver.com> Message-ID: Ping. -- Maxim Kuvyrkov CodeSourcery / Mentor Graphics On 30/05/2012, at 3:17 AM, Mark Hatle wrote: > This was just an oversight it appears. I'm working on a number of merges into the cross prelinker today. Hopefully in a few days it will be tested and pushed. If you don't see anything, feel free to keep reminding me. > > --Mark > > On 5/25/12 10:42 PM, Maxim Kuvyrkov wrote: >> On 11/04/2012, at 8:23 AM, Mark Hatle wrote: >> >>> On 4/10/12 2:56 PM, Maxim Kuvyrkov wrote: >>>> On 11/04/2012, at 7:46 AM, Mark Hatle wrote: >>>> >>>>> On 4/10/12 2:27 PM, Maxim Kuvyrkov wrote: >>>>>> Mark, >>>>>> >>>>>> This patch makes rtld emulator in cross prelink use ld.so's name as it is encoded in PT_INTERP header. >>>>>> >>>>>> Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's name, but the linker actually expects "/lib/ld.so.1" -- that one slash at the beginning causes prelink checks done by the runtime linker to fail and not use prelink information. >>>>>> >>>>>> The runtime linker sets up a map for itself under the name stored in PT_INTERP header of the executable, and this patch makes rtld emulator follow the suit. >>>>>> >>>>>> I have tested this patch using a different version of rtld emulator (the one that CodeSourcery / Mentor maintains), but the function in question is the same in both, so this patch is also relevant for Yocto's prelink. >>>>>> >>>>>> Any comments? Please merge at your leisure. >>>>> >>>>> prelinker currently checks that the ld.so name matches what it's expecting for any given arch in the PL_ARCH structure. Does this change any of that behavior? Or does it simply change the internal prelink-rtld behavior so that it the prelink-rtld acts as if it's name is the PT_INTERP element? >>>> >>>> It is the latter. Only behavior of prelink-rtld is change to the effect that it outputs "/lib/ld.so.1 -> /lib/ld.so.1 ..." as executable's dependency. >>>> >>>> Forgot to mention: the dependency on ld.so.1 [usually] comes from libdl.so, which is, probably, why this bug wasn't noticed before. >>> >>> Thanks, I think I understand what is going on now. I'll look into getting this merged into the cross prelinker later today or tomorrow. >> >> Mark, >> >> This patch is still not merged to cross-prelink, did you encounter a problem with it? >> >> Thank you, >> >> -- >> Maxim Kuvyrkov >> CodeSourcery / Mentor Graphics > From mark.hatle@windriver.com Thu Jun 28 02:29:00 2012 From: mark.hatle@windriver.com (Mark Hatle) Date: Thu, 28 Jun 2012 02:29:00 -0000 Subject: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch In-Reply-To: References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> <4F848E15.1030905@windriver.com> <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> <4F8496BA.3010706@windriver.com> <10862750-7E5E-4B2C-9FEF-1EADEB197044@codesourcery.com> <4FC4E890.5010307@windriver.com> Message-ID: <4FEBC165.8070100@windriver.com> On 6/27/12 5:34 PM, Maxim Kuvyrkov wrote: > Ping. Hmm, I thought I replied sorry. The patch is in the cross prelinker. http://git.yoctoproject.org/cgit/cgit.cgi/prelink-cross/commit/?h=cross_prelink&id=104e49c827b1b452910e0415acf72b8008990141 --Mark > -- > Maxim Kuvyrkov > CodeSourcery / Mentor Graphics > > > On 30/05/2012, at 3:17 AM, Mark Hatle wrote: > >> This was just an oversight it appears. I'm working on a number of merges into the cross prelinker today. Hopefully in a few days it will be tested and pushed. If you don't see anything, feel free to keep reminding me. >> >> --Mark >> >> On 5/25/12 10:42 PM, Maxim Kuvyrkov wrote: >>> On 11/04/2012, at 8:23 AM, Mark Hatle wrote: >>> >>>> On 4/10/12 2:56 PM, Maxim Kuvyrkov wrote: >>>>> On 11/04/2012, at 7:46 AM, Mark Hatle wrote: >>>>> >>>>>> On 4/10/12 2:27 PM, Maxim Kuvyrkov wrote: >>>>>>> Mark, >>>>>>> >>>>>>> This patch makes rtld emulator in cross prelink use ld.so's name as it is encoded in PT_INTERP header. >>>>>>> >>>>>>> Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's name, but the linker actually expects "/lib/ld.so.1" -- that one slash at the beginning causes prelink checks done by the runtime linker to fail and not use prelink information. >>>>>>> >>>>>>> The runtime linker sets up a map for itself under the name stored in PT_INTERP header of the executable, and this patch makes rtld emulator follow the suit. >>>>>>> >>>>>>> I have tested this patch using a different version of rtld emulator (the one that CodeSourcery / Mentor maintains), but the function in question is the same in both, so this patch is also relevant for Yocto's prelink. >>>>>>> >>>>>>> Any comments? Please merge at your leisure. >>>>>> >>>>>> prelinker currently checks that the ld.so name matches what it's expecting for any given arch in the PL_ARCH structure. Does this change any of that behavior? Or does it simply change the internal prelink-rtld behavior so that it the prelink-rtld acts as if it's name is the PT_INTERP element? >>>>> >>>>> It is the latter. Only behavior of prelink-rtld is change to the effect that it outputs "/lib/ld.so.1 -> /lib/ld.so.1 ..." as executable's dependency. >>>>> >>>>> Forgot to mention: the dependency on ld.so.1 [usually] comes from libdl.so, which is, probably, why this bug wasn't noticed before. >>>> >>>> Thanks, I think I understand what is going on now. I'll look into getting this merged into the cross prelinker later today or tomorrow. >>> >>> Mark, >>> >>> This patch is still not merged to cross-prelink, did you encounter a problem with it? >>> >>> Thank you, >>> >>> -- >>> Maxim Kuvyrkov >>> CodeSourcery / Mentor Graphics >> >