Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
1 Use the platform specific ELF branding expected under FreeBSD.
2 This is similar to what the vendor ld(1) does on this platform.
4 Additionally, recognize and ignore Solaris 10's "Solaris Cryptographic
5 Framework" ELF header type "SUNW_signature", Solaris 10 "Symbol
6 information" ELF header type "SUNW_syminfo" and Solaris 10 "DTrace
7 Object Format" ELF header type. Also, fix the path to the dynamic
8 linker under Solaris 10/amd64.
10 Index: include/elf/common.h
11 --- include/elf/common.h.orig 2011-07-22 22:22:36.000000000 +0200
12 +++ include/elf/common.h 2011-11-22 21:09:42.000000000 +0100
13 @@ -475,6 +475,9 @@
14 #define SHT_SUNW_verdef 0x6ffffffd /* Versions defined by file */
15 #define SHT_SUNW_verneed 0x6ffffffe /* Versions needed by file */
16 #define SHT_SUNW_versym 0x6fffffff /* Symbol versions */
17 +#define SHT_SUNW_syminfo 0x6ffffffc /* Symbol information */
18 +#define SHT_SUNW_signature 0x6ffffff6 /* Solaris Cryptographic Framework: Digital Signature */
19 +#define SHT_SUNW_dof 0x6ffffff4 /* Solaris DTrace Object Format */
21 #define SHT_GNU_verdef SHT_SUNW_verdef
22 #define SHT_GNU_verneed SHT_SUNW_verneed
23 Index: bfd/elf.c
24 --- bfd/elf.c.orig 2011-07-03 15:37:06.000000000 +0200
25 +++ bfd/elf.c 2011-11-22 21:09:42.000000000 +0100
26 @@ -1907,6 +1907,11 @@
27 elf_tdata (abfd)->dynverref_hdr = *hdr;
28 return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
30 + case SHT_SUNW_syminfo:
31 + /* case SHT_SUNW_signature: conflicts with new SHT_GNU_HASH in Binutils 2.18 */
32 + case SHT_SUNW_dof:
33 + return TRUE;
34 +
35 case SHT_SHLIB:
36 return TRUE;
38 @@ -5103,6 +5108,12 @@
39 else
40 i_ehdrp->e_type = ET_REL;
42 + /* OpenPKG platform branding BEGIN */
43 +#if defined(OPENPKG_OS_FREEBSD)
44 + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
45 +#endif
46 + /* OpenPKG platform branding END */
47 +
48 switch (bfd_get_arch (abfd))
49 {
50 case bfd_arch_unknown:
51 Index: bfd/elf64-x86-64.c
52 --- bfd/elf64-x86-64.c.orig 2011-11-21 10:29:25.000000000 +0100
53 +++ bfd/elf64-x86-64.c 2011-11-22 21:12:41.000000000 +0100
54 @@ -512,8 +512,13 @@
55 /* The name of the dynamic interpreter. This is put in the .interp
56 section. */
58 +#if defined(OPENPKG_OS_SOLARIS)
59 +#define ELF64_DYNAMIC_INTERPRETER "/lib/amd64/ld.so.1"
60 +#define ELF32_DYNAMIC_INTERPRETER "/lib/ld32.so.1"
61 +#else
62 #define ELF64_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
63 #define ELF32_DYNAMIC_INTERPRETER "/lib/ld32.so.1"
64 +#endif
66 /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
67 copying dynamic variables from a shared lib into an app's dynbss
69 -----------------------------------------------------------------------------
71 Fight problems with --disable-nls under Solaris
73 Index: gas/asintl.h
74 --- gas/asintl.h.orig 2007-07-03 13:01:02.000000000 +0200
75 +++ gas/asintl.h 2011-11-22 21:09:42.000000000 +0100
76 @@ -20,6 +20,11 @@
77 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
78 02110-1301, USA. */
80 +#ifndef ENABLE_NLS
81 +# define _LIBINTL_H
82 +# define _LIBGETTEXT_H
83 +#endif
84 +
85 #ifdef HAVE_LOCALE_H
86 # ifndef ENABLE_NLS
87 /* The Solaris version of locale.h always includes libintl.h. If we have
88 Index: ld/ld.h
89 --- ld/ld.h.orig 2011-07-16 09:58:40.000000000 +0200
90 +++ ld/ld.h 2011-11-22 21:09:42.000000000 +0100
91 @@ -23,6 +23,11 @@
92 #ifndef LD_H
93 #define LD_H
95 +#ifndef ENABLE_NLS
96 +# define _LIBINTL_H
97 +# define _LIBGETTEXT_H
98 +#endif
99 +
100 #ifdef HAVE_LOCALE_H
101 #endif
102 #ifndef SEEK_CUR
103 Index: ld/Makefile.in
104 --- ld/Makefile.in.orig 2011-07-22 22:22:37.000000000 +0200
105 +++ ld/Makefile.in 2011-11-22 21:09:42.000000000 +0100
106 @@ -366,7 +366,7 @@
107 # We put the scripts in the directory $(scriptdir)/ldscripts.
108 # We can't put the scripts in $(datadir) because the SEARCH_DIR
109 # directives need to be different for native and cross linkers.
110 -scriptdir = $(tooldir)/lib
111 +scriptdir = $(libdir)
112 BASEDIR = $(srcdir)/..
113 BFDDIR = $(BASEDIR)/bfd
114 INCDIR = $(BASEDIR)/include
116 -----------------------------------------------------------------------------
118 Workaround problems under Mac OS X.
120 Index: libiberty/fibheap.c
121 --- libiberty/fibheap.c.orig 2009-05-29 05:01:15.000000000 +0200
122 +++ libiberty/fibheap.c 2011-11-22 21:09:42.000000000 +0100
123 @@ -34,8 +34,11 @@
124 #include "libiberty.h"
125 #include "fibheap.h"
127 -
128 +#ifdef LONG_MIN
129 #define FIBHEAPKEY_MIN LONG_MIN
130 +#else
131 +#define FIBHEAPKEY_MIN (-0x7fffffffL - 1)
132 +#endif
134 static void fibheap_ins_root (fibheap_t, fibnode_t);
135 static void fibheap_rem_root (fibheap_t, fibnode_t);
137 -----------------------------------------------------------------------------
139 Disable the "error" about "eh_frame_hdr" as it is actually more a
140 warning (the linking is *not* aborted) and it occurs at least under
141 FreeBSD-7.0/amd64 regularily without doing any obvious harm. Seems
142 like the issue itself exists since a longer time, but in recent GNU
143 binutils this additional message was introduced. As we cannot observe
144 any problems and this message really confused, just disable it for now.
146 Index: bfd/elf-eh-frame.c
147 --- bfd/elf-eh-frame.c.orig 2011-06-20 15:18:47.000000000 +0200
148 +++ bfd/elf-eh-frame.c 2011-11-22 21:09:42.000000000 +0100
149 @@ -913,9 +913,11 @@
150 goto success;
152 free_no_table:
153 +#if 0
154 (*info->callbacks->einfo)
155 (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"),
156 abfd, sec);
157 +#endif
158 hdr_info->table = FALSE;
159 if (sec_info)
160 free (sec_info);