On Fri, Jul 07, 2006 at 05:47:57PM +0900, Magnus Damm wrote:
> On 7/6/06, Jan Kratochvil <[EMAIL PROTECTED]> wrote:
> >On Thu, 06 Jul 2006 04:32:26 +0200, Magnus Damm wrote:
> >...
> >> > Not sure which approach is better but got a question. By definition, 
> >are
> >> > executable files supposed to be relocatable?
> >
> >No. Unless you provide --emit-relocs.
> 
> Right.

I think --emit-relocs is just emitting relocations which have already
been processed. In your approach you are just taking a clue where all
relocations have been applied in this executable file and try to 
relocate. As I said previously, you are effectively chaning the type of
relocation.

For example, If you encounter a relocation type R_386_32, ideally
it should be (S+A). Where S is symbol value and A is addend. But you
have replaced symbol value(S) with a offset (The difference between
the address where executable has been loaded and the address for which
it has been compiled). Effectively turning the relocation into
R_386_RELATIVE. IMHO, this kind of looks hackish.

While going through ld man page, I hit upon another interesting option.
"--pic-executable". This is supposed to generate position independent
executable which needs to be relocated like shared libraries. How
about this using this option? I am yet to play a little bit with this.

Thanks
Vivek 
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to