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.


>> +#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:

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

* My understanding is that <elf.h> provides at least the definitions that are relevant for the target system, which is what matter here, and does not
  hardcode any path.

* The following GDB tests include <elf.h>:
	./gdb.arch/ppc-dfp.c:#include <elf.h>
	./gdb.base/jit-main.c:#include <elf.h>

   There is not test including any other elf header.

Can you comment on this?

Thank you,

Nicolas





Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


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