public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Trouble with sections attributes for embedded target
@ 2002-08-28  5:49 Xavier Ordoquy
  2002-08-29 16:08 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Xavier Ordoquy @ 2002-08-28  5:49 UTC (permalink / raw)
  To: gcc

Hi

I'm working on a cross compiler for embedded 68k target and I've tried
to use gcc instead of the commercial tool.
The cross compilation seems to work but I'm lacking something in the
last steps.

I'm linking some objects files that I've been given and some that I
compiled with gcc and here's the output of gcc:

app.ieee:     file format ieee

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 CODE          00001ae4  00000000  00000000  00000000  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  1 zerovars      0000003c  00001ae4  00001ae4  00000000  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00000214  00001b20  00001b20  00000000  2**2
                  ALLOC, DATA
  3 .debug        00002498  00000000  00000000  00002e2a  2**0
                  CONTENTS, DEBUGGING

Now here's the output of the commercial compiler for the same sources:

../appli.x:     file format ieee

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 CODE          0000182e  00000000  00000000  00000000  2**1
                  CONTENTS, ALLOC, LOAD, CODE
  1 zerovars      0000020c  00000000  00000000  00000000  2**1
                  ALLOC, DATA
  2 .debug        00006a64  00000000  00000000  00002e0c  2**0
                  CONTENTS, DEBUGGING

As you can see, alignement are differents, CODE section has a DATA flag
for gcc whereas it should be code and I can't get rid of the .bss
section.

I've tried to use attribute((section("CODE"))) but the compiler
complains m68k-aout doesn't support this.

Here's my link script:

OUTPUT_FORMAT("a.out-zero-big", "a.out-zero-big",
	      "a.out-zero-big")

OUTPUT_ARCH(m68k)

SECTIONS
{

  . = 0x00;

  CODE :
  {
    defentry.o 
    *("0")
    *(.text)
    *(code)
  }

  zerovars :
  {
    *(.dynamic)
    *(.got)
    *(.plt)
    *(.data)
    *(.linux-dynamic) /* For Linux dynamic linking.  */
  }

  .bss :
  {
   *(.bss)
   *(COMMON)
  }
}


and the commands I use for gcc:

m68k-aout-gcc -mpcrel -mcpu32 -fPIC -c -ansi -pedantic -Iinc entry.c
m68k-aout-ld --verbose -T ld.conf --oformat=ieee -Map app.map -o
app.ieee entry.o defentry.o *.obj *.OBJ

I need to have similar outputs as the last generation step is an
application that changes things in order to meet the embedded OS design.

Has anyone any idea ?

-- 

Xavier Ordoquy
Chef de projet SESAM-Vitale
Meditrans

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Trouble with sections attributes for embedded target
  2002-08-28  5:49 Trouble with sections attributes for embedded target Xavier Ordoquy
@ 2002-08-29 16:08 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2002-08-29 16:08 UTC (permalink / raw)
  To: Xavier Ordoquy; +Cc: gcc

On Wed, Aug 28, 2002 at 02:47:39PM +0200, Xavier Ordoquy wrote:
> I've tried to use attribute((section("CODE"))) but the compiler
> complains m68k-aout doesn't support this.

Indeed, m68k-aout does *not* support this.  You need to use
some more capable intermediate format, e.g. m68k-elf.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-29 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-28  5:49 Trouble with sections attributes for embedded target Xavier Ordoquy
2002-08-29 16:08 ` Richard Henderson

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).