public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: david.hagood@gmail.com
To: binutils@sourceware.org
Subject: Strange ARM issue: wrong exception table type?
Date: Wed, 01 Feb 2012 16:40:00 -0000	[thread overview]
Message-ID: <35a37ea957466b2f7a770e7978aebfef.squirrel@localhost> (raw)

I am having a strange issue with cross-compiling ARM programs. When I
build a C++ executable that throws exceptions, they don't work: no catch()
statements work, and all throw operations go straight to std::terminate().
My co-workers, who are using in theory the exact same tool chain, don't
see this (and I've checked the md5sum of their tools vs. mine and they
seem to match).

I've traced it down to the assembler: I can have them compile the C++ file
to a .s, and just assemble and link it, and it breaks. If they send me a
.o and I link that, it works. The assembler files they send me are the
same as the ones my compiler generates (verified via diff), but the
objects they produce vs. the objects I produce are different.

I've traced the point of difference to the .ARM.extab and .ARM.exidx
sections:

Contents of section .ARM.extab:
- 0000 00000080 84429b01 b0b0b083 ff002501  .....B........%.
+ 0000 00000000 84429b01 b0b0b083 ff002501  .....B........%.
  0010 1b1c9001 ac0101c0 01040000 dc013cac  ..............<.

Contents of section .ARM.exidx:
- 0000 00000080 00000080 7c010080 34000080  ........|...4...
- 0010 e0010080 40000080                    ....@...
+ 0000 00000000 00000000 7c010000 34000000  ........|...4...
+ 0010 e0010000 40000000                    ....@...

If I read the ARM EABI spec correctly, the difference is that my assembler
is generating the ARM Compact form (bit 31 set), and theirs are generating
the standard form. I assume that's preventing the run time library from
finding the catch() blocks.

What would cause my "as" to generate a different output than theirs for
the same input file? (and I've verified the MD5 of my "as" and theirs
match). And how can I fix this?

             reply	other threads:[~2012-02-01 16:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 16:40 david.hagood [this message]
2012-02-02 10:45 ` Matthew Gretton-Dann
2012-02-02 15:31   ` david.hagood
2012-02-02 15:53     ` Matthew Gretton-Dann
2012-02-02 16:28   ` david.hagood
2012-02-02 17:07     ` Matthew Gretton-Dann
2012-02-02 17:23       ` david.hagood
2012-10-11 12:25         ` Guido Piasenza

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=35a37ea957466b2f7a770e7978aebfef.squirrel@localhost \
    --to=david.hagood@gmail.com \
    --cc=binutils@sourceware.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).