From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: brendan@dgs.monash.edu.au Cc: binutils@sourceware.cygnus.com Subject: Re: Using objdump to force a section to load with gdb. Date: Thu, 01 Jul 1999 00:00:00 -0000 Message-id: <19990618185152.22692.qmail@daffy.airs.com> References: <3766EA73.123505A6@dgs.monash.edu.au> <19990618052534.26635.qmail@daffy.airs.com> <3769EC4D.99196D87@dgs.monash.edu.au> <3769EC4D.99196D87@dgs.monash.edu.au> X-SW-Source: 1999-q2/msg00286.html Date: Fri, 18 Jun 1999 06:50:53 +0000 From: Brendan Simon > 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" ? You don't. At the time that the executable has been created, the program segments have been created. objcopy is not currently capable of modifying the program segment information. Other than teaching objcopy how to modify program segments, one approach you can use is to include the vmlinux.gz file in the link which creates the executable in the first place. Put it in the right place with the linker script, and link against it using -b binary. I believe that is what the i386 Linux kernel build procedure does. Ian