michael@68: Use the platform specific ELF branding expected under FreeBSD. michael@68: This is similar to what the vendor ld(1) does on this platform. michael@68: michael@68: Additionally, recognize and ignore Solaris 10's "Solaris Cryptographic michael@68: Framework" ELF header type "SUNW_signature", Solaris 10 "Symbol michael@68: information" ELF header type "SUNW_syminfo" and Solaris 10 "DTrace michael@68: Object Format" ELF header type. Also, fix the path to the dynamic michael@68: linker under Solaris 10/amd64. michael@68: michael@68: Index: include/elf/common.h michael@425: --- include/elf/common.h.orig 2011-07-22 22:22:36.000000000 +0200 michael@425: +++ include/elf/common.h 2011-11-22 21:09:42.000000000 +0100 michael@425: @@ -475,6 +475,9 @@ michael@68: #define SHT_SUNW_verdef 0x6ffffffd /* Versions defined by file */ michael@68: #define SHT_SUNW_verneed 0x6ffffffe /* Versions needed by file */ michael@68: #define SHT_SUNW_versym 0x6fffffff /* Symbol versions */ michael@68: +#define SHT_SUNW_syminfo 0x6ffffffc /* Symbol information */ michael@68: +#define SHT_SUNW_signature 0x6ffffff6 /* Solaris Cryptographic Framework: Digital Signature */ michael@68: +#define SHT_SUNW_dof 0x6ffffff4 /* Solaris DTrace Object Format */ michael@68: michael@68: #define SHT_GNU_verdef SHT_SUNW_verdef michael@68: #define SHT_GNU_verneed SHT_SUNW_verneed michael@68: Index: bfd/elf.c michael@425: --- bfd/elf.c.orig 2011-07-03 15:37:06.000000000 +0200 michael@425: +++ bfd/elf.c 2011-11-22 21:09:42.000000000 +0100 michael@425: @@ -1907,6 +1907,11 @@ michael@68: elf_tdata (abfd)->dynverref_hdr = *hdr; michael@68: return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); michael@68: michael@68: + case SHT_SUNW_syminfo: michael@68: + /* case SHT_SUNW_signature: conflicts with new SHT_GNU_HASH in Binutils 2.18 */ michael@68: + case SHT_SUNW_dof: michael@68: + return TRUE; michael@68: + michael@68: case SHT_SHLIB: michael@68: return TRUE; michael@68: michael@425: @@ -5103,6 +5108,12 @@ michael@68: else michael@68: i_ehdrp->e_type = ET_REL; michael@68: michael@68: + /* OpenPKG platform branding BEGIN */ michael@68: +#if defined(OPENPKG_OS_FREEBSD) michael@68: + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; michael@68: +#endif michael@68: + /* OpenPKG platform branding END */ michael@68: + michael@68: switch (bfd_get_arch (abfd)) michael@68: { michael@68: case bfd_arch_unknown: michael@68: Index: bfd/elf64-x86-64.c michael@425: --- bfd/elf64-x86-64.c.orig 2011-11-21 10:29:25.000000000 +0100 michael@425: +++ bfd/elf64-x86-64.c 2011-11-22 21:12:41.000000000 +0100 michael@425: @@ -512,8 +512,13 @@ michael@68: /* The name of the dynamic interpreter. This is put in the .interp michael@68: section. */ michael@68: michael@68: +#if defined(OPENPKG_OS_SOLARIS) michael@425: +#define ELF64_DYNAMIC_INTERPRETER "/lib/amd64/ld.so.1" michael@425: +#define ELF32_DYNAMIC_INTERPRETER "/lib/ld32.so.1" michael@68: +#else michael@425: #define ELF64_DYNAMIC_INTERPRETER "/lib/ld64.so.1" michael@425: #define ELF32_DYNAMIC_INTERPRETER "/lib/ld32.so.1" michael@68: +#endif michael@68: michael@68: /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid michael@68: copying dynamic variables from a shared lib into an app's dynbss michael@68: michael@68: ----------------------------------------------------------------------------- michael@68: michael@68: Fight problems with --disable-nls under Solaris michael@68: michael@68: Index: gas/asintl.h michael@331: --- gas/asintl.h.orig 2007-07-03 13:01:02.000000000 +0200 michael@425: +++ gas/asintl.h 2011-11-22 21:09:42.000000000 +0100 michael@68: @@ -20,6 +20,11 @@ michael@68: Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA michael@68: 02110-1301, USA. */ michael@68: michael@68: +#ifndef ENABLE_NLS michael@68: +# define _LIBINTL_H michael@68: +# define _LIBGETTEXT_H michael@68: +#endif michael@68: + michael@68: #ifdef HAVE_LOCALE_H michael@68: # ifndef ENABLE_NLS michael@68: /* The Solaris version of locale.h always includes libintl.h. If we have michael@68: Index: ld/ld.h michael@425: --- ld/ld.h.orig 2011-07-16 09:58:40.000000000 +0200 michael@425: +++ ld/ld.h 2011-11-22 21:09:42.000000000 +0100 michael@68: @@ -23,6 +23,11 @@ michael@68: #ifndef LD_H michael@68: #define LD_H michael@68: michael@68: +#ifndef ENABLE_NLS michael@68: +# define _LIBINTL_H michael@68: +# define _LIBGETTEXT_H michael@68: +#endif michael@68: + michael@68: #ifdef HAVE_LOCALE_H michael@68: #endif michael@68: #ifndef SEEK_CUR michael@68: Index: ld/Makefile.in michael@425: --- ld/Makefile.in.orig 2011-07-22 22:22:37.000000000 +0200 michael@425: +++ ld/Makefile.in 2011-11-22 21:09:42.000000000 +0100 michael@425: @@ -366,7 +366,7 @@ michael@68: # We put the scripts in the directory $(scriptdir)/ldscripts. michael@68: # We can't put the scripts in $(datadir) because the SEARCH_DIR michael@68: # directives need to be different for native and cross linkers. michael@68: -scriptdir = $(tooldir)/lib michael@68: +scriptdir = $(libdir) michael@68: BASEDIR = $(srcdir)/.. michael@68: BFDDIR = $(BASEDIR)/bfd michael@68: INCDIR = $(BASEDIR)/include michael@68: michael@68: ----------------------------------------------------------------------------- michael@68: michael@331: Workaround problems under Mac OS X. michael@68: michael@68: Index: libiberty/fibheap.c michael@331: --- libiberty/fibheap.c.orig 2009-05-29 05:01:15.000000000 +0200 michael@425: +++ libiberty/fibheap.c 2011-11-22 21:09:42.000000000 +0100 michael@68: @@ -34,8 +34,11 @@ michael@68: #include "libiberty.h" michael@68: #include "fibheap.h" michael@68: michael@68: - michael@68: +#ifdef LONG_MIN michael@68: #define FIBHEAPKEY_MIN LONG_MIN michael@68: +#else michael@68: +#define FIBHEAPKEY_MIN (-0x7fffffffL - 1) michael@68: +#endif michael@68: michael@68: static void fibheap_ins_root (fibheap_t, fibnode_t); michael@68: static void fibheap_rem_root (fibheap_t, fibnode_t); michael@68: michael@68: ----------------------------------------------------------------------------- michael@68: michael@68: Disable the "error" about "eh_frame_hdr" as it is actually more a michael@68: warning (the linking is *not* aborted) and it occurs at least under michael@68: FreeBSD-7.0/amd64 regularily without doing any obvious harm. Seems michael@68: like the issue itself exists since a longer time, but in recent GNU michael@68: binutils this additional message was introduced. As we cannot observe michael@68: any problems and this message really confused, just disable it for now. michael@68: michael@68: Index: bfd/elf-eh-frame.c michael@425: --- bfd/elf-eh-frame.c.orig 2011-06-20 15:18:47.000000000 +0200 michael@425: +++ bfd/elf-eh-frame.c 2011-11-22 21:09:42.000000000 +0100 michael@425: @@ -913,9 +913,11 @@ michael@331: goto success; michael@68: michael@331: free_no_table: michael@68: +#if 0 michael@68: (*info->callbacks->einfo) michael@68: (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"), michael@68: abfd, sec); michael@68: +#endif michael@331: hdr_info->table = FALSE; michael@68: if (sec_info) michael@331: free (sec_info);