public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alan Nilsson <alan.n@mac.com>
To: gcc-help@gcc.gnu.org
Subject: need help with gcc_except_table
Date: Wed, 10 Mar 2010 03:08:00 -0000	[thread overview]
Message-ID: <E2135703-CF8E-4DE0-BE2B-32DA68AB79DB@mac.com> (raw)

I have 2 cross compilers that target m68k-elf (coldfire):

1. GCC 4.2.1 (binutils 2.18) - host = windows
2. GCC 4.4.2 (binutils 2.20) - host = OSX(intel)

the first was provided by the vendor of the embedded system I am working with, the second I built.  They both work fine when creating code that links against the vendors non-debug static libs.  However, when I link (with the 4.4.2/2.20 combo) against the debug versions of the vendor supplied libs,  I get several gcc_except_table sections at the beginning of the code.  This does not happen with the vendors 4.2.1/2.18 setup.  The embedded system must have the start of text at 0x020000000, but with the exception entries it gets pushed back to around 0x020000A0 so when it loads it traps.

I built the 4.4.2 gcc with the same configure flags that the vendor supplied gcc was compiled with (less the windows specific), I am using the same crt & link script with both compilers.  I know that the non-debug libs were built with -fno-exceptoins and the debug versions were built without this flag.  I can see gcc_except_table sections in the debug libs when viewed via readelf.  But again, when linking with 4.2.1/2.18 is does not happen.

I was reading Ian Lance Taylor's linking articles on his blog from back in 2007, but the info on gcc_except_table was very short.  It did imply that there was a optimization that moved the exception tables from inline with the text to the beginning of text, or did I misunderstand?

The elf file gets converted to s-records before it gets loaded onto the embedded system, I could easily enough strip out the exception tables and shift the address of everything else so the text starts at the correct place, but is this asking for trouble?

Or is this case of simply not being able to use libs with exceptions built on a windows host on a different host?  If anyone has any pointers on where I should look to resolve this I would sure like hear.

thanks
alan

             reply	other threads:[~2010-03-10  3:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10  3:08 Alan Nilsson [this message]
2010-03-10 16:15 ` Ian Lance Taylor

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=E2135703-CF8E-4DE0-BE2B-32DA68AB79DB@mac.com \
    --to=alan.n@mac.com \
    --cc=gcc-help@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).