[PATCH 01/11] [POWERPC] bootwrapper: Allow specifying of image physical offset

Paul Mackerras paulus at samba.org
Thu Apr 10 12:25:34 EST 2008


Kumar Gala writes:

> So now we can look at the vmlinux and determine the physical offset.   
> The question is how best to do that.  Here are the options I see:
> * readelf, grep and parse output
> * objdump grep and parse output
> * simple C program that read's the elf and reports back

Either readelf or objdump for now, and if that proves to be fragile we
can look at a C program.  You could do:

readelf -l $vmlinux | grep -m 1 LOAD | awk '{print $4}'

or

objdump -p $vmlinux | grep -m 1 LOAD | awk '{print $7}'

There's not a lot of difference.  Since the wrapper already uses
objdump, I think we should use objdump rather than making the wrapper
depend on an additional program (readelf).

> The other questions is if we'd ever have a vmlinux with more than one  
> PT_LOAD PHDR.  If so which one do we use (the one with the lowest  
> physical address)?

I think we would take the first one.

Paul.



More information about the Linuxppc-dev mailing list