From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brendan Simon To: Jonathan Larmour , Magnus Damm , Dan Malek , gdb , binutils Subject: SOLVED: objdump or gdb to force a section to load ? Date: Thu, 01 Jul 1999 00:00:00 -0000 Message-id: <376996F2.1F150FCF@dgs.monash.edu.au> References: <3766EA73.123505A6@dgs.monash.edu.au> <199906171606.RAA15562@peshwari.cygnus.co.uk> <376981EF.BE10D7C8@dgs.monash.edu.au> <37699391.2CF83050@cygnus.co.uk> X-SW-Source: 1999-q2/msg00278.html 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.