mailing list of musl libc
 help / color / mirror / code / Atom feed
* another armv7-m exception handling problem
@ 2019-10-21  4:43 Patrick Oppenlander
  2019-10-21  5:04 ` Rich Felker
  2019-10-21 18:09 ` Szabolcs Nagy
  0 siblings, 2 replies; 13+ messages in thread
From: Patrick Oppenlander @ 2019-10-21  4:43 UTC (permalink / raw)
  To: musl

Not sure if this is a musl, gcc or ld bug.

Running gcc-8.3.0 musl 1.1.24 static pie.

Simple test case:

int main()
{
        try {
                throw 1;
        } catch (int d) {
                return d;
        }
        return 0;
}

Expected:
% ./a.out
% echo $?
1

Actual:
% ./a.out
terminate called after throwing an instance of 'int'
terminate called recursively
Aborted (core dumped)

The problem is that get_eit_entry is returning _URC_FAILURE here:

  if (__gnu_Unwind_Find_exidx)
    {
      eitp = (const __EIT_entry *) __gnu_Unwind_Find_exidx (return_address,
                                                            &nrec);
      if (!eitp)
        {
          UCB_PR_ADDR (ucbp) = 0;
          return _URC_FAILURE;        <----- !!!!
        }
    }

Looks like a linker or program load problem to me -- the GOT entry for
__gnu_Unwind_Find_exidx is correctly set to 0, but after program load
it's been offset to some non-zero value. There's an R_ARM_RELATIVE
relocation on the GOT entry.

Not sure where this is going wrong.

Kind regards,

Patrick


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

end of thread, other threads:[~2020-01-11  6:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21  4:43 another armv7-m exception handling problem Patrick Oppenlander
2019-10-21  5:04 ` Rich Felker
2019-10-21  5:20   ` Rich Felker
2019-10-21  5:34     ` Patrick Oppenlander
2019-10-21  5:38       ` Rich Felker
2019-10-21  5:51         ` Patrick Oppenlander
2019-10-21 18:09 ` Szabolcs Nagy
2019-10-21 19:03   ` Rich Felker
2019-10-21 19:08     ` Szabolcs Nagy
2019-10-21 19:29       ` Rich Felker
2020-01-10 10:22         ` Szabolcs Nagy
2020-01-11  6:20           ` Patrick Oppenlander
2019-10-21 21:17   ` Patrick Oppenlander

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).