This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/4 v3] IPA: Add alloc_jump_pad_buffer target hook.
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: koriakin at 0x04 dot net (Marcin KoÅcielnicki)
- Cc: gdb-patches at sourceware dot org, koriakin at 0x04 dot net (Marcin KoÅcielnicki)
- Date: Fri, 1 Apr 2016 16:43:46 +0200 (CEST)
- Subject: Re: [PATCH 2/4 v3] IPA: Add alloc_jump_pad_buffer target hook.
- Authentication-results: sourceware.org; auth=none
> * linux-aarch64-ipa.c: Add <sys/mman.h> and <sys/auxv.h> includes.
> (alloc_jump_pad_buffer): New function.
> * linux-amd64-ipa.c: Add <sys/mman.h> include.
> (alloc_jump_pad_buffer): New function.
> * linux-i386-ipa.c (alloc_jump_pad_buffer): New function.
> * linux-s390-ipa.c: Add <sys/mman.h> and <sys/auxv.h> includes.
> (alloc_jump_pad_buffer): New function.
> * tracepoint.c (getauxval) [!HAVE_GETAUXVAL]: New function.
> (initialize_tracepoint): Delegate to alloc_jump_pad_buffer.
> * tracepoint.h (alloc_jump_pad_buffer): New prototype.
> (getauxval) [!HAVE_GETAUXVAL]: New prototype.
This caused a build failure on my RHEL5 Cell daily build, due to
gdb/gdbserver/linux-ppc-ipa.c: In function 'alloc_jump_pad_buffer':
gdb/gdbserver/linux-ppc-ipa.c:120: error: 'AT_PHDR' undeclared (first use in this function)
The problem seems to be that this system is so old it doesn't have
a <sys/auvx.h> header. You do provide a fallback getauxval implementation
for those systems, but the AT_PHDR value isn't available. It is actually
defined in my system headers, in <elf.h>, but this isn't pulled in ---
usually it would be implicitly included from <sys/auxv.h>.
It might be best to add an explicit #include <elf.h> to all files that
make use of AT_... constants, in case HAVE_GETAUXVAL is false.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com