public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Xavier Ordoquy <xordoquy@meditrans.fr>
To: gcc@gcc.gnu.org
Subject: Trouble with sections attributes for embedded target
Date: Wed, 28 Aug 2002 05:49:00 -0000	[thread overview]
Message-ID: <1030538860.16862.22.camel@ninja> (raw)

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

             reply	other threads:[~2002-08-28  5:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-28  5:49 Xavier Ordoquy [this message]
2002-08-29 16:08 ` Richard Henderson

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=1030538860.16862.22.camel@ninja \
    --to=xordoquy@meditrans.fr \
    --cc=gcc@gcc.gnu.org \
    /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).