public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgcc: On AIX, increase chances to find landing pads for exceptions
@ 2016-02-08 12:15 Michael Haubenwallner
  2016-02-08 13:59 ` David Edelsohn
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Haubenwallner @ 2016-02-08 12:15 UTC (permalink / raw)
  To: David Edelsohn; +Cc: GCC Patches, Ian Lance Taylor

[-- Attachment #1: Type: text/plain, Size: 917 bytes --]

Hi David,

still experiencing exception-not-caught problems with gcc-4.2.4 on AIX
leads me to some patch proposed in http://gcc.gnu.org/PR13878 back in
2004 already, ought to be fixed by some different commit since 3.4.0.

As long as build systems (even libtool right now) on AIX do export these
_GLOBAL__* symbols from shared libraries, overlapping frame-base address
ranges may become registered, even if newer gcc (seen with 4.8) does name
the FDE symbols more complex to reduce these chances.

But still, just think of linking some static library into multiple shared
libraries and/or the main executable. Or sometimes there is just need for
some hackery to override a shared object's implementation detail and rely
on runtime linking to do the override at runtime.

Agreed both is "wrong" to some degree, but the larger an application is,
the higher is the chance for this to happen.

Thoughts?

Thanks!
/haubi/

[-- Attachment #2: libgcc-On-AIX-increase-chances-to-find-landing-pads-.patch --]
[-- Type: text/x-patch, Size: 1579 bytes --]

2016-02-08  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>

	On AIX, increase chances to find landing pads for exceptions.
	* unwind-dw2-fde.c (_Unwind_Find_FDE): Stop assuming registered
	object's address ranges to not overlap.

--- libgcc/unwind-dw2-fde.c
+++ libgcc/unwind-dw2-fde.c
@@ -1013,7 +1013,25 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
 	f = search_object (ob, pc);
 	if (f)
 	  goto fini;
+	/*
 	break;
+	   In an ideal world, even on AIX, we could break here because
+	   objects would not overlap. But the larger an application is,
+	   the more likely an "overlap" may happen (on AIX) because of:
+	   - Shared libraries do export the FDE symbols ("_GLOBAL__F*"),
+	     which is a bug in their build system, but out of gcc's control.
+	   - Other shared libraries, or the main executable, do contain
+	     identical or similar object files - which is suboptimal,
+	     but may be intentional. However, exporting their FDE symbols,
+	     which may have identical names as seen in the former shared
+	     libraries, again is a bug in their build system, but still
+	     out of gcc's control.
+	   - Finally, run time linking is enabled, redirecting adresses of
+	     identically named exported symbols from their original shared
+	     library's address range into another shared library's or the
+	     main executable's address range.
+	   This results in address ranges being registered by different
+	   objects to potentially overlap.  */
       }
 
   /* Classify and search the objects we've not yet processed.  */

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

end of thread, other threads:[~2016-03-01 13:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 12:15 libgcc: On AIX, increase chances to find landing pads for exceptions Michael Haubenwallner
2016-02-08 13:59 ` David Edelsohn
2016-02-10 10:03   ` Michael Haubenwallner
2016-02-10 13:27     ` David Edelsohn
2016-02-12  9:57       ` Michael Haubenwallner
2016-03-01 12:10     ` Michael Haubenwallner
2016-03-01 13:14       ` David Edelsohn

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