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: "Blanc, Nicolas" <nicolas dot blanc at intel dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "dje at google dot com" <dje at google dot com>
- Date: Thu, 18 Jul 2013 12:51:48 +0000
- 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>
>> +#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