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
On Thu, Mar 09, 2000 at 10:07:12PM -0800, Ian Lance Taylor wrote:
[my question about lma not getting set by ld in elf output file]
> 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.)
Ah... Now I understand. When I tried testing the AT()
directive using a .text segment and elf32-i386 it worked.
because the .text segment has it's LOAD flag set by default.
A warning about setting LMA on a non-LOAD segment probably
would have provided enough of a kick in the head that I would
have realized what was going on. Maybe in my copious spare time
I'll look into that...
> 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.
Yup, doing a .section .boot[01],"ax" made everything work the
way I expected it to.
Thanks!
--
Grant Edwards
grante@visi.com