Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2002 13:19:27 +0000
From:      "Peter Edwards" <pmedwards@eircom.net>
To:        lev@serebryakov.spb.ru
Cc:        freebsd@cs.tin.it, hackers@freebsd.org
Subject:   Re[2]: dlinfo() from sunOS, _DYNAMIC from Linux: did we have something like this?
Message-ID:  <20021219134727.A7C3943E4A@mx1.FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Hi,
Actually, the FreeBSD linker does put _DYNAMIC int executables, it's just not declared
in any headerfile, so I assume some config script isn't picking it up. You can declare
it as

#include <elf.h>
extern Elf_Dyn DYNAMIC[];

(The FreeBSD ELF headers will typedef Elf_Dyn from either Elf32_Dyn, or Elf64_Dyn,
depending on your platform.) To hack the offending code into working, you could do
something like this at the top.

#ifdef __FreeBSD__
#include <elf.h>
extern Elf_Dyn DYNAMIC[];

#undef HAVE_DECL__DYNAMIC
#undef HAVE_ELF32_DYN
#undef HAVE_ELF64_DYN

#define HAVE_DECL__DYNAMIC 1
#if __ELF_WORD_SIZE == 32
#define HAVE_ELF32_DYN 1
#define HAVE_ELF64_DYN 0
#else
#define HAVE_ELF64_DYN 1
#define HAVE_ELF32_DYN 0
#endif

.. and cross your fingers before compiling.
-- 
Peter Edwards.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021219134727.A7C3943E4A>