verma wrote:
> I have getting segmentation fault in _setup.c in rtld in code when ld.so.1 is 
> doing self relocation.
> I am playing with Sparc and i386 both.
> I am trying to understand the ld.so.1 on various plateform.
> I think this is due to changes permission of data segment(RWX to RW).
> Could you please tell me  this is due to permissions or some other problems.

I have no idea.  You still haven't provided any information regarding
the segmentation fault - ie. stack trace?  Without this no one knows
where you are seg faulting or why.  If you suspect the segment permissions
then why are you changing them?  Run your object under truss and report
the segv information - use a debugger or pstack to determine the stack
trace.

> Could you please explain me how is self relocation of ld.so.1 is done and is 
> this architecture dependent .

ld.so.1 is a shared object, and like any other shared object, must be
relocated once its location in memory is known.  The relocations
within ld.so.1 are very simple as -Bsymbolic is used to build ld.so.1
(this results in only RELATIVE relocations being generated).  ld.so.1
has its own simple "self" relocation loop that handles these relative
relocations.  Prior to this point, ld.so.1 can't reference any of its
own non-automatic data items.  Once relocation is complete, ld.so.1
can reference all data items within itself freely.

Besides REL/RELA handling, the relocation loop for ld.so.1 is the
same for each architecture.


-- 
Rod

Reply via email to