This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
SOLVED: objdump or gdb to force a section to load ?
- To: Jonathan Larmour <jlarmour@cygnus.co.uk>, Magnus Damm <eramdam@kieray1.p.y.ki.era.ericsson.se>, Dan Malek <dmalek@jlc.net>, gdb <gdb@sourceware.cygnus.com>, binutils <binutils@sourceware.cygnus.com>
- Subject: SOLVED: objdump or gdb to force a section to load ?
- From: Brendan Simon <brendan@dgs.monash.edu.au>
- Date: Fri, 18 Jun 1999 00:46:42 +0000
- Organization: CTAM Pty Ltd
- References: <3766EA73.123505A6@dgs.monash.edu.au> <199906171606.RAA15562@peshwari.cygnus.co.uk> <376981EF.BE10D7C8@dgs.monash.edu.au> <37699391.2CF83050@cygnus.co.uk>
- Reply-To: brendan@dgs.monash.edu.au
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.