This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v12 5/5] Test adding and removing a symbol file at runtime.
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: nicolas dot blanc at intel dot com
- Cc: mark dot kettenis at xs4all dot nl, gdb-patches at sourceware dot org, dje at google dot com
- Date: Thu, 18 Jul 2013 15:28:23 +0200 (CEST)
- Subject: Re: [PATCH v12 5/5] Test adding and removing a symbol file at runtime.
- References: <1374078455-906-1-git-send-email-nicolas dot blanc at intel dot com> <1374078455-906-6-git-send-email-nicolas dot blanc at intel dot com> <201307171852 dot r6HIquNI026465 at glazunov dot sibelius dot xs4all dot nl> <388084C8C1E6A64FA36AD1D656E485661A7B11F5 at IRSMSX106 dot ger dot corp dot intel dot com>
> From: "Blanc, Nicolas" <nicolas.blanc@intel.com>
> Date: Thu, 18 Jul 2013 12:51:48 +0000
>
> >> +#include <elf.h>
> >
> >The <elf.h> header isn't standardized at all. So this testcase
> >probably only compile on systems that use glibc as their C library.
> >Might not even work on a significant fraction of systems that use a
> >Linux kernel.
> >
> >Perhaps it is possible to use the headers from include/elf in the
> >src tree instead?
>
> Thanks Mark of looking into this patch. I can change the include, no
> big deal, but <elf.h> looks more portable to me than
> </usr/include/elf.h> for the following reasons:
I wasn't suggesting to use /usr/include/elf.h, but rather the header
files in $(srcdir)/../include/elf.
> * The man pages for Linux and FreeBSD both mention <elf.h> but not
> * </usr/include/elf.h>:
> http://man7.org/linux/man-pages/man5/elf.5.html
> http://www.freebsd.org/cgi/man.cgi?query=elf&sektion=5&apropos=0&manpath=FreeBSD+9.1-RELEASE
>
> I could compile the test on following distros: Fedora 15, Red Hat
> 6.2, Ubuntu 12.4, and SUSE 11.1. And <elf.h> is even available on
> Cygwin.
It's not available on OpenBSD and NetBSD, although we have a somewhat
similar header called <elf_abi.h> on OpenBSD (and probably on NetBSD
too). But even on the platforms that do have <elf.h> its contents
aren't completely standardized. So you'll need to be very careful
with what defenitions you use. That's why I'm suggesting to use a
header provided by gdb (or rather BFD) itself as.
> * The following GDB tests include <elf.h>:
> ./gdb.arch/ppc-dfp.c:#include <elf.h>
> ./gdb.base/jit-main.c:#include <elf.h>
Didn't catch the ppc-dfp.c test yet, since it runs only on PowerPC.
The problems with jit-main.c is the reason why I pointed this out to
you ;).