[PATCH V4] ldso: fix fdpic support broken from prelink patch

Filippo ARCIDIACONO filippo.arcidiacono at st.com
Mon Apr 2 10:13:39 UTC 2012



> -----Original Message-----
> From: Mike Frysinger [mailto:vapier at gentoo.org]
> Sent: Saturday, March 31, 2012 5:27 PM
> To: Filippo ARCIDIACONO
> Cc: uclibc at uclibc.org
> Subject: Re: [PATCH V4] ldso: fix fdpic support broken from prelink
> patch
> 
> On Thursday 29 March 2012 04:50:02 Filippo ARCIDIACONO wrote:
> > --- a/ldso/ldso/dl-startup.c
> > +++ b/ldso/ldso/dl-startup.c
> >
> > -	SEND_ADDRESS_STDERR_DEBUG(DL_LOADADDR_BASE(header), 1);
> > +	SEND_ADDRESS_STDERR_DEBUG(header, 1);
> 
> before fdpic, this was:
> 	SEND_ADDRESS_STDERR_DEBUG(header, 1);
> 
> after fdpic, it was:
> 	SEND_ADDRESS_STDERR_DEBUG(DL_LOADADDR_BASE(load_addr), 1);
> 
> after prelink, it was:
> 	SEND_ADDRESS_STDERR_DEBUG(DL_LOADADDR_BASE(header), 1);
> 
> now it's back to:
> 	SEND_ADDRESS_STDERR_DEBUG(header, 1);
> 
> i think it's supposed to be:
> 	SEND_ADDRESS_STDERR_DEBUG(
> 		DL_LOADADDR_BASE(DL_GET_LOADADDR_MAPADDR(load_addr,
> header)),
> 		1);
> can you confirm ?  or should it even be simpler and just always use
> load_addr ?

No, because the load_addr is 0 when the dynamic linker itself is prelinked
(otherwise load_addr and header have the same value).
I was think the header, coming from the auxiliary vector, was ok for all arch
regardless if the dynamic linker is prelinked or not.
Using:
	DL_LOADADDR_BASE(DL_GET_LOADADDR_MAPADDR(load_addr, header)), 1);
for sure we are safe, even if the original purpose of DL_GET_LOADADDR_MAPADDR
was to return the map address or load address according to the architectures,
perhaps it should be worth to change the name of the macro to something like
DL_GET_ADDRESS or something else.
Let me know, so that I will post the final version.

> -mike

Filippo.



More information about the uClibc mailing list