This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: strange ld message "allocated section not in segment"
- From: Daniel Jacobowitz <drow at false dot org>
- To: Peter Barada <peter at the-baradas dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 15 Sep 2005 17:14:35 -0400
- Subject: Re: strange ld message "allocated section not in segment"
- References: <20050915205931.2A27A98474@baradas.org>
On Thu, Sep 15, 2005 at 04:59:31PM -0400, Peter Barada wrote:
>
> I'm trying to figure out why the following message pops out of ld:
>
> /opt/logicpd/ColdFire/m68k-elf-3.4.3/libexec/gcc/m68k-elf/3.4.3/collect2 -o led_flasher.elf -N -L/opt/logicpd/ColdFire/m68k-elf-3.4.3/lib/gcc/m68k-elf/3.4.3/m5407 -L/opt/logicpd/ColdFire/m68k-elf-3.4.3/lib/gcc/m68k-elf/3.4.3 -L/opt/logicpd/ColdFire/m68k-elf-3.4.3/lib/gcc/m68k-elf/3.4.3/../../../../m68k-elf/lib arch/m68k/apicrt0.o led_flasher.o arch/m68k/arch_led_flasher.o -lgcc -T api.ldssc
> /opt/logicpd/ColdFire/m68k-elf-3.4.3/lib/gcc/m68k-elf/3.4.3/../../../../m68k-elf/bin/ld: led_flasher.elf: warning: allocated section `.bss' not in segment
>
> Even though (if I understand correctly), I list .bss to be placed into
> the 'bss' segment via the PHDRS command. Any idea why this message is
> appearing? Here's the linker cmd file:
>
> ENTRY(_start)
>
> PHDRS
> {
> text PT_LOAD ;
> bss PT_NULL ;
> }
That's your problem. PT_NULL means "entry unused". You really want it
to be a PT_LOAD segment.
--
Daniel Jacobowitz
CodeSourcery, LLC