This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Basing to 0 loses CONTENTS of code section, bug or feature?.
- From: Ray Whitmer <ray at xmission dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 31 Mar 2004 17:27:45 -0700 (MST)
- Subject: Basing to 0 loses CONTENTS of code section, bug or feature?.
Another stab at my basing problem. When I base a section at 0, it
suddenly loses it's CONTENTS attribute. If I base it at 1 (bad idea
for alignment) or any higher address, it does not lose this attribute
and the executable is much larger.
Same example as before:
m68k-coff-ld --no-check_sections -T test.spc test.o -o test
The test.spc is:
SECTIONS
{
ROM 0 (NOLOAD) : {
*(.text)
*(.data)
}
RAM 0 (NOLOAD) : {
*(.bss)
}
}
I get a very small executable in which the ROM section does not have
the CONTENTS attribute even though the .text and .data sections had
the CONTENTS attribute..
If I change the base of ROM from 0 to 1, then suddenly the ROM section
has the CONTENTS attribute and the executable is much larger, containing
the code, which is lost when the base address is 0.
It makes no difference whether I specify or omit NOLOAD, the behavior is
the same.
Why does changing the base address to 0 cause the contents to be lost
in this way, and how can I get around that undesirable effect.
Thanks,
Ray