[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb
Subject:    DT_NULL and solib-svr4.c again
From:       Andrew Cagney <ac131313 () cygnus ! com>
Date:       2000-11-24 11:43:52
Message-ID: 3A1E52A0.4BB631C6 () cygnus ! com
[Download RAW message or body]


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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic