This is the mail archive of the gdb@sources.redhat.com 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]

DT_NULL and solib-svr4.c again


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

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