atom feed3 messages in org.freebsd.freebsd-hackersRe[2]: dlinfo() from sunOS, _DYNAMIC ...
FromSent OnAttachments
Lev SerebryakovDec 17, 2002 1:03 pm 
Lev SerebryakovDec 19, 2002 4:19 am 
Peter EdwardsDec 19, 2002 5:19 am 
Subject:Re[2]: dlinfo() from sunOS, _DYNAMIC from Linux: did we have something like this?
From:Peter Edwards (pmed@eircom.net)
Date:Dec 19, 2002 5:19:05 am
List:org.freebsd.freebsd-hackers

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.

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