SOLVED: objdump or gdb to force a section to load ?
Brendan Simon
brendan@dgs.monash.edu.au
Thu Jul 1 00:00:00 GMT 1999
I think I've solved the "load" flag problem. I can't confirm it on my target but
objdump seems to report the right things.
Jonathan Larmour wrote:
> Try changing this to:
>
> $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
> --add-section=image=../coffboot/vmlinux.gz \
> --set-section-flags=image=load,data \
> --adjust-section-vma=image=????
> zvmlinux.tmp $@
>
> Choose an appropriate ???? - read the objcopy man page for details of this
> arg. And when you have something working, recommend the ppc-linux folks
> making the same change to the main makefiles since I believe it should be
> harmless for normal usage (although you may want to verify).
I tried something similar before I got your email. I thought that objcopy might be
doing something funny because the vma was zero.
objcopy --adjust-section-vma=image=0x00100000 tempImage relocImage
objcopy --set-section-flags=image=load
This still does not work. I can however set some other attributes such as READONLY.
I tried a few combinations and found that
"--set-section-flags=image=load,alloc,readonly" does work even thought it complains
with "BFD: sta00639: warning: allocated section `image' not in segment". I then
tried the same options on the original file (with out any section vma offsets) and it
also worked. I guess it was just a matter of finding the right combinations of flags
and putting them in the right order. HOPEFULLY gdb will now load the image section
but I wont be able to confirm this until I get home tonight.
Thanks for your help.
Brendan Simon.
More information about the Binutils
mailing list