Instead we now link the bootwrapper with -pie to get a position-
independent executable, and process the relocations in the dynamic
relocation section that the linker puts into the executable.

Hurray!  Looks good, just a few nits...

+       bl      .+4
+p_base:        mflr    r10             /* r10 now points to runtime addr of 
p_base */

bl p_base  instead?

+10:    or.     r8,r0,r9        /* skip relocation if we don't have both */
        beq     3f

Either the code or the comment is wrong -- the code says "skip relocation
if we don't have either".

+       cmpwi   r0,22           /* R_PPC_RELATIVE */
+       bne     3f

It would be nice if there was some way to complain (at build time?)
if there are unhandled relocations present.  Prevents a lot of headaches
when things go wrong (and they will ;-) )

 4:     dcbf    r0,r9
        icbi    r0,r9

Fix these while you're at it?  It's not r0, it's 0.

+  .dynsym : { *(.dynsym) }
+  .dynstr : { *(.dynstr) }
+  .dynamic :
+  {
+    __dynamic_start = .;
+    *(.dynamic)
+  }
+  .hash : { *(.hash) }
+  .interp : { *(.interp) }
+  .rela.dyn : { *(.rela*) }

Do some of these sections need alignment?


Segher

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to