This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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 v12 5/5] Test adding and removing a symbol file at runtime.


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


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