This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Using objdump to force a section to load with gdb.
- To: Ian Lance Taylor <ian@zembu.com>, binutils <binutils@sourceware.cygnus.com>
- Subject: Re: Using objdump to force a section to load with gdb.
- From: Brendan Simon <brendan@dgs.monash.edu.au>
- Date: Fri, 18 Jun 1999 06:50:53 +0000
- Organization: CTAM Pty Ltd
- References: <3766EA73.123505A6@dgs.monash.edu.au> <19990618052534.26635.qmail@daffy.airs.com>
- Reply-To: brendan@dgs.monash.edu.au
Ian Lance Taylor wrote:
> The problem with using objcopy to set the LOAD flag is that the only
> sections which are loaded are those which are stored in program
> segments. objcopy isn't prepared to create a new program segment in
> order to change a section flag. This would be difficult to fix.
>
> If your loader reads the section headers rather than the segment
> headers, then you may be able to make this work by doing something
> like
> powerpc-linux-objcopy --set-section-flags=image=alloc,load myzimage
> The reason is that ELF records the ALLOC flag in the section header,
> and objcopy should know how to change that.
>
> The best way to make a loadable section is to mark the section as
> loadable in the first place. See the gas documentation for how to set
> the section flags when using the .section directive.
I'm not sure if this is applicable when the section is added with "objcopy
--add-section=image=vmlinux.gz", where vmlinux.gz is an elf file that has been
compressed with gzip. How does one add this file as a section to an existing
elf file (bootloader) as "loadable in the first place" ?
Brendan Simon.