public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, libbacktrace]: Fix PR 71161, Lots of ASAN and libgo runtime FAILs on 32bit x86 targets
@ 2016-05-18 12:12 Uros Bizjak
  2016-05-18 12:33 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2016-05-18 12:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ian Lance Taylor

Hello!

The issue here is a misaligned stack with some old(er) 32bit x86
glibcs, where dl_iterate_phdr callback gets called with misaligned
stack.

Attached patch makes phdr_callback in libbacktrace resistant to this
ABI violation.

2016-05-18  Uros Bizjak  <ubizjak@gmail.com>

    * elf.c (phdr_callback) [__i386__]: Add
    __attribute__((__force_align_arg_pointer__)).

Patch was bootstrapped on x86_64-linux-gnu and regression tested with -m32.

OK for mainline and release branches?

Uros.

diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
index f85ac65..81ba344 100644
--- a/libbacktrace/elf.c
+++ b/libbacktrace/elf.c
@@ -866,6 +866,9 @@ struct phdr_data
    libraries.  */

 static int
+#ifdef __i386__
+__attribute__ ((__force_align_arg_pointer__))
+#endif
 phdr_callback (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED,
               void *pdata)
 {

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

* Re: [PATCH, libbacktrace]: Fix PR 71161, Lots of ASAN and libgo runtime FAILs on 32bit x86 targets
  2016-05-18 12:12 [PATCH, libbacktrace]: Fix PR 71161, Lots of ASAN and libgo runtime FAILs on 32bit x86 targets Uros Bizjak
@ 2016-05-18 12:33 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2016-05-18 12:33 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

Uros Bizjak <ubizjak@gmail.com> writes:

> 2016-05-18  Uros Bizjak  <ubizjak@gmail.com>
>
>     * elf.c (phdr_callback) [__i386__]: Add
>     __attribute__((__force_align_arg_pointer__)).

This is OK.

Thanks.

Ian

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

end of thread, other threads:[~2016-05-18 12:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-18 12:12 [PATCH, libbacktrace]: Fix PR 71161, Lots of ASAN and libgo runtime FAILs on 32bit x86 targets Uros Bizjak
2016-05-18 12:33 ` Ian Lance Taylor

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