public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew.lunn@ascom.ch>
To: binutils@sources.redhat.com
Subject: Change in .ld syntax or a bug?
Date: Thu, 15 Sep 2005 13:01:00 -0000	[thread overview]
Message-ID: <20050915121708.GO11369@donkey.ma.tech.ascom.ch> (raw)

Hi Folks

Debian unstable is using binutils 2.16.1cvs20050902. I've found that
this causes problem with the RTOS eCos.

gcc -finline-limit=7000 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions   -nostdlib -Wl,-r -Wl,--whole-archive -o /home/lunn/eCos/work/install/lib/extras.o /home/lunn/eCos/work/install/lib/libextras.a
gcc -L/home/lunn/eCos/work/install/lib -Ttarget.ld -o /home/lunn/eCos/work/install/tests/hal/common/current/tests/context tests/context.o -g -nostdlib -Wl,--gc-sections -Wl,-static
/usr/bin/ld: address 0x28b3 of /home/lunn/eCos/work/install/tests/hal/common/current/tests/context section .text is not within region rom
/usr/bin/ld: address 0x328b of /home/lunn/eCos/work/install/tests/hal/common/current/tests/context section .rodata is not within region rom
/usr/bin/ld: address 0x3304 of /home/lunn/eCos/work/install/tests/hal/common/current/tests/context section .eh_frame is not within region rom
/usr/bin/ld: address 0x28b3 of /home/lunn/eCos/work/install/tests/hal/common/current/tests/context section .text is not within region rom
/usr/bin/ld: address 0x328b of /home/lunn/eCos/work/install/tests/hal/common/current/tests/context section .rodata is not within region rom
/usr/bin/ld: address 0x32ec of /home/lunn/eCos/work/install/tests/hal/common/current/tests/context section .eh_frame is not within region rom
collect2: ld returned 1 exit status

If i downgrade to an older version of binutils, eg 2.16.1 it links OK.

target.ld contains:

STARTUP(vectors.o)
ENTRY(_start)
INPUT(extras.o)
GROUP(libtarget.a libgcc.a libsupc++.a libgcc_eh.a)




MEMORY
{
    rom : ORIGIN = 0x1000000, LENGTH = 0x800000
    ram : ORIGIN = 0x2000000, LENGTH = 0x800000
}

SECTIONS
{

    .vectors 0x1000000 : { . = .; KEEP(*(.vectors)) } > rom
    .text ALIGN (0x4) : { _stext = .; *(.text*) *(.gnu.warning) *(.gnu.linkonce.t.*) *(.init) } > rom _etext = .; PROVIDE (etext = .);
    .fini ALIGN (0x4) : { . = .; *(.fini) } > rom
    .rodata1 ALIGN (0x8) : { . = .; *(.rodata1) } > rom
    .rodata ALIGN (0x8) : { . = .; *(.rodata*) *(.gnu.linkonce.r.*) } > rom
    .fixup ALIGN (0x4) : { _FIXUP_START_ = ABSOLUTE(.); *(.fixup) _FIXUP_END_ =
ABSOLUTE(.);} > rom
    .rel.text : { *(.rel.text) *(.rel.text.*) *(.rel.gnu.linkonce.t*) } > rom .rela.text : { *(.rela.text) *(.rela.text.*) *(.rela.gnu.linkonce.t*) } > rom .rel.data : { *(.rel.data) *(.rel.data.*) *(.rel.gnu.linkonce.d*) } > rom .rela.data : { *(.rela.data) *(.rela.data.*) *(.rela.gnu.linkonce.d*) } > rom .rel.rodata
: { *(.rel.rodata) *(.rel.rodata.*) *(.rel.gnu.linkonce.r*) } > rom .rela.rodata : { *(.rela.rodata) *(.rela.rodata.*) *(.rela.gnu.linkonce.r*) } > rom .rel.got : { *(.rel.got) } > rom .rela.got : { *(.rela.got) } > rom .rel.ctors : { *(.rel.ctors) } > rom .rela.ctors : { *(.rela.ctors) } > rom .rel.dtors : { *(.rel.dtors) } > rom .rela.dtors : { *(.rela.dtors) } > rom .rel.init : { *(.rel.init) } > rom .rela.init : { *(.rela.init) } > rom .rel.fini : { *(.rel.fini) } > rom .rela.fini : { *(.rela.fini) } > rom .rel.bss : { *(.rel.bss) } > rom .rela.bss : { *(.rela.bss) } > rom .rel.plt : { *(.rel.plt) } > rom .rela.plt : { *(.rela.plt) } > rom .rel.dyn : { *(.rel.dyn) } > rom
    .eh_frame ALIGN (0x4) : { . = .; __EH_FRAME_BEGIN__ = .; KEEP(*(.eh_frame))
__FRAME_END__ = .; . = . + 8; } > rom = 0
    .rel.got ALIGN (0x1) : { *(.rel.got) } > rom
    .gcc_except_table ALIGN (0x1) : { _EXCEPT_START_ = ABSOLUTE(.); *(.gcc_except_table) _EXCEPT_END_ = ABSOLUTE(.);} > rom
    .data 0x2000000 : { __ram_data_start = ABSOLUTE(.); *(.data*) *(.gnu.linkonce.d.*) _GOT1_START_ = ABSOLUTE(.); *(.got1) _GOT1_END_ = ABSOLUTE(.); . = ALIGN(8); __CTOR_LIST__ = ABSOLUTE(.); KEEP(*(SORT(.ctors*))) __CTOR_END__ = ABSOLUTE(.); __DTOR_LIST__ = ABSOLUTE(.); KEEP(*(SORT(.dtors*))) __DTOR_END__ = ABSOLUTE(.); . = ALIGN(32); KEEP(*( SORT (.ecos.table.*))); _GOT2_START_ = ABSOLUTE(.); *(.got2) _GOT2_END_ = ABSOLUTE(.); _GOT_START_ = ABSOLUTE(.); _GLOBAL_OFFSET_TABLE_ = ABSOLUTE(. + 32768); _SDA_BASE_ = ABSOLUTE(.); *(.got.plt) *(.got) _GOT_END_ = ABSOLUTE(.); *(.dynamic) _SDATA_START_ = ABSOLUTE(.); *(.sdata*) *(.gnu.linkonce.s.*) } > ram __rom_data_start = LOADADDR(.data); __ram_data_end = .; PROVIDE(__ram_data_end = .); _edata = .; PROVIDE (edata = .);
    .sbss ALIGN (0x4) : { __bss_start = ABSOLUTE (.); _SBSS_START_ = ABSOLUTE(.); *(.sbss*) *(.gnu.linkonce.sb.*) _SBSS_END_ = ABSOLUTE(.); *(.scommon*) } > ram    .bss ALIGN (0x10) : { . = .; *(.dynbss*) *(.bss*) *(COMMON) *(.gnu.linkonce.b.*) } > ram __bss_end = .;
    __heap1 = ALIGN (0x10);
    . = ALIGN(4); _end = .; PROVIDE (end = .);
}

It looks like ld is happy with sections which explicit set there
address, eg .vectors and .data, but sections which just follow on from
the previous section it is not happy with and seems to put them
outside of memory.

Has there recently been a change in syntax? Or is this a bug?

    Thanks
        Andrew

             reply	other threads:[~2005-09-15 12:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-15 13:01 Andrew Lunn [this message]
2005-09-15 13:39 ` Alan Modra
2005-09-15 13:43   ` Andrew Lunn
2005-09-16  5:36     ` Alan Modra
2005-09-16  8:25       ` Andrew Lunn
2005-09-19  7:44         ` Alan Modra
2005-09-19 14:23           ` Andrew Lunn
2005-09-20  2:59             ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050915121708.GO11369@donkey.ma.tech.ascom.ch \
    --to=andrew.lunn@ascom.ch \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).