This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: can't get vma != lma to work
- To: grante at visi dot com
- Subject: Re: can't get vma != lma to work
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 9 Mar 2000 22:07:12 -0800
- CC: binutils at sourceware dot cygnus dot com
- References: <20000309191831.A22081@visi.com>
Date: Thu, 9 Mar 2000 19:18:32 -0600
From: Grant Edwards <grante@visi.com>
P.S. Is there a way to tell ld to set the "LOAD" flag for
sections .boot1 and .boot0? I know I can do it with
objcopy, but I wondered if there was a way to tell the
linker to do it.
I expect that this is your problem, actually. In ELF, the load
address is stored in the program segments (objdump will print this
when given the -p option). Sections which are not loaded do not get
program segments. Therefore, there is no place to record the
different load address, and it gets dropped. (The linker should
probably warn about this case.)
The linker will set the LOAD flag based on the characteristics of the
input sections. The normal way to set the LOAD flag is to arrange for
it to be set in the input sections. I don't know how you are creating
the .boot0 and .boot1 sections. If you are doing it in the assembler,
add the appropriate flags to the .section pseudo-op; see the assembler
documentation.
You could also use the PHDRS command to push the sections into a
loadable segment, I suppose.
The linker doesn't provide much direct control over the flags of the
output sections. That too is arguably a bug.
Ian