This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
DT_NULL and solib-svr4.c again
- To: GDB Discussion <gdb at sourceware dot cygnus dot com>
- Subject: DT_NULL and solib-svr4.c again
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 24 Nov 2000 22:36:00 +1100
FYI,
Previously I reported a compile when trying to build a cross target that
included solib-svr4.c (I tried X-i386-linux this time :-).
Briefly, the problem comes from the include magic:
#ifndef SVR4_SHARED_LIBS
/* SunOS shared libs need the nlist structure. */
#include <a.out.h>
#else
#include "elf/external.h"
#endif
#ifdef HAVE_LINK_H
#include <link.h>
#endif
Some systems define DT_NULL and DT_DEBUG in <link.h>. Others do not.
My first idea for a fix was to include "elf/common.h" instead of
<link.h> (after all including <link.h> can't be right when building a
cross target). It wouldn't compile :-(
Turned out that solib-svr4.h also contained:
struct link_map_offsets *
default_svr4_fetch_link_map_offsets (void)
....
lmo.r_map_offset = offsetof (struct r_debug, r_map);
lmo.r_map_size = fieldsize (struct r_debug, r_map);
and r_debug is obtained from the hosts <link.h> :-(
enjoy,
Andrew