This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add missing unwind information to ld.so on powerpc32 (bug 23707)


* Andreas Schwab:

> diff --git a/elf/Makefile b/elf/Makefile
> index 037f68165b..455ec730fc 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile

> +$(objpfx)tst-unwind-ctor: $(objpfx)tst-unwind-ctor-lib.so

Does this link with libunwind on some targets?

Would it be possible to side-step this issue if we made it a C++ test,
so that the unwinder is linked in automatically?

> diff --git a/elf/tst-unwind-ctor-lib.c b/elf/tst-unwind-ctor-lib.c
> new file mode 100644
> index 0000000000..f517e43ec4
> --- /dev/null
> +++ b/elf/tst-unwind-ctor-lib.c

> +static void
> +__attribute__ ((constructor))
> +do_unwind (void)
> +{
> +  /* Arrange for this test to be killed if _Unwind_Backtrace runs into an
> +     endless loop.  */
> +  alarm (20);
> +  _Unwind_Backtrace (callback, 0);
> +}

Please augment the comment to indicate that this code would run before
the test driver has a chance to set up the timeout.

> diff --git a/elf/tst-unwind-ctor.c b/elf/tst-unwind-ctor.c
> new file mode 100644
> index 0000000000..96100527b2
> --- /dev/null
> +++ b/elf/tst-unwind-ctor.c

> +int
> +main (void)
> +{
> +  dummy ();
> +}

Perhaps add a comment saying that this tests an ELF constructor, so that
the test driver is useless?

(Of course, this should tell us something about our test framework …)

Otherwise, the fix and test look good to me.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]