]> git.pld-linux.org Git - packages/elfutils.git/blob - elfutils-portability.patch
- updated to 0.151
[packages/elfutils.git] / elfutils-portability.patch
1 --- elfutils/backends/ChangeLog
2 +++ elfutils/backends/ChangeLog
3 @@ -111,6 +111,10 @@
4         * ppc_attrs.c (ppc_check_object_attribute): Handle tag
5         GNU_Power_ABI_Struct_Return.
6  
7 +2009-01-23  Roland McGrath  <roland@redhat.com>
8 +
9 +       * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
10 +
11  2008-10-04  Ulrich Drepper  <drepper@redhat.com>
12  
13         * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
14 @@ -438,6 +442,11 @@
15         * sparc_init.c: Likewise.
16         * x86_64_init.c: Likewise.
17  
18 +2005-11-22  Roland McGrath  <roland@redhat.com>
19 +
20 +       * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
21 +       (libebl_%.so rule): Use it in place of -Wl,--as-needed.
22 +
23  2005-11-19  Roland McGrath  <roland@redhat.com>
24  
25         * ppc64_reloc.def: REL30 -> ADDR30.
26 @@ -460,6 +469,9 @@
27         * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
28         (CLEANFILES): Add libebl_$(m).so.
29  
30 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
31 +       (AM_CFLAGS): Use it in place of -Wextra.
32 +
33         * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
34         * ppc64_reloc.def: Likewise.
35  
36 --- elfutils/backends/Makefile.am
37 +++ elfutils/backends/Makefile.am
38 @@ -103,7 +103,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
39         $(LINK) -shared -o $(@:.map=.so) \
40                 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
41                 -Wl,--version-script,$(@:.so=.map) \
42 -               -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
43 +               -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
44         $(textrel_check)
45  
46  libebl_i386.so: $(cpu_i386)
47 --- elfutils/ChangeLog
48 +++ elfutils/ChangeLog
49 @@ -7,6 +7,10 @@
50  
51         * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
52  
53 +2009-11-22  Roland McGrath  <roland@redhat.com>
54 +
55 +       * configure.ac: Use sed and expr instead of modern bash extensions.
56 +
57  2009-09-21  Ulrich Drepper  <drepper@redhat.com>
58  
59         * configure.ac: Update for more modern autoconf.
60 @@ -15,6 +19,10 @@
61  
62         * configure.ac (zip_LIBS): Check for liblzma too.
63  
64 +2009-08-17  Roland McGrath  <roland@redhat.com>
65 +
66 +       * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
67 +
68  2009-04-19  Roland McGrath  <roland@redhat.com>
69  
70         * configure.ac (eu_version): Round down here, not in version.h macros.
71 @@ -26,6 +34,8 @@
72  
73  2009-01-23  Roland McGrath  <roland@redhat.com>
74  
75 +       * configure.ac: Check for __builtin_popcount.
76 +
77         * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
78  
79         * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
80 @@ -106,6 +116,10 @@
81         * configure.ac: Add dummy automake conditional to get dependencies
82         for non-generic linker right.  See src/Makefile.am.
83  
84 +2005-11-22  Roland McGrath  <roland@redhat.com>
85 +
86 +       * configure.ac: Check for --as-needed linker option.
87 +
88  2005-11-18  Roland McGrath  <roland@redhat.com>
89  
90         * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
91 @@ -153,6 +167,17 @@
92         * Makefile.am (all_SUBDIRS): Add libdwfl.
93         * configure.ac: Write libdwfl/Makefile.
94  
95 +2005-05-31  Roland McGrath  <roland@redhat.com>
96 +
97 +       * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
98 +
99 +       * configure.ac: Check for struct stat st_?tim members.
100 +       * src/strip.c (process_file): Use st_?time if st_?tim are not there.
101 +
102 +       * configure.ac: Check for futimes function.
103 +       * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
104 +       (handle_ar) [! HAVE_FUTIMES]: Likewise.
105 +
106  2005-05-19  Roland McGrath  <roland@redhat.com>
107  
108         * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
109 --- elfutils/config/eu.am
110 +++ elfutils/config/eu.am
111 @@ -25,11 +25,14 @@
112  ## <http://www.openinventionnetwork.com>.
113  ##
114  
115 +WEXTRA = @WEXTRA@
116 +LD_AS_NEEDED = @LD_AS_NEEDED@
117 +
118  DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
119  INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
120  AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
121             $(if $($(*F)_no_Werror),,-Werror) \
122 -           $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
123 +           $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
124             $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
125             $($(*F)_CFLAGS)
126  
127 --- elfutils/configure.ac
128 +++ elfutils/configure.ac
129 @@ -73,6 +73,54 @@ CFLAGS="$old_CFLAGS"])
130  AS_IF([test "x$ac_cv_c99" != xyes],
131        AC_MSG_ERROR([gcc with C99 support required]))
132  
133 +AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
134 +old_CFLAGS="$CFLAGS"
135 +CFLAGS="$CFLAGS -Wextra"
136 +AC_COMPILE_IFELSE([void foo (void) { }],
137 +                 ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
138 +CFLAGS="$old_CFLAGS"])
139 +AC_SUBST(WEXTRA)
140 +AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
141 +
142 +AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
143 +old_CFLAGS="$CFLAGS"
144 +CFLAGS="$CFLAGS -fgnu89-inline -Werror"
145 +AC_COMPILE_IFELSE([
146 +void foo (void)
147 +{
148 +  inline void bar (void) {}
149 +  bar ();
150 +}
151 +extern inline void baz (void) {}
152 +], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
153 +CFLAGS="$old_CFLAGS"])
154 +AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
155 +      [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
156 +
157 +AC_CACHE_CHECK([for --as-needed linker option],
158 +              ac_cv_as_needed, [dnl
159 +cat > conftest.c <<EOF
160 +int main (void) { return 0; }
161 +EOF
162 +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
163 +                           -fPIC -shared -o conftest.so conftest.c
164 +                           -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
165 +then
166 +  ac_cv_as_needed=yes
167 +else
168 +  ac_cv_as_needed=no
169 +fi
170 +rm -f conftest*])
171 +AS_IF([test "x$ac_cv_as_needed" = xyes],
172 +      [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
173 +AC_SUBST(LD_AS_NEEDED)
174 +
175 +AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
176 +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
177 +              ac_cv_popcount=yes, ac_cv_popcount=no)])
178 +AS_IF([test "x$ac_cv_popcount" = xyes],
179 +      [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
180 +
181  AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
182  # Use the same flags that we use for our DSOs, so the test is representative.
183  # Some old compiler/linker/libc combinations fail some ways and not others.
184 @@ -88,7 +136,10 @@ static __thread int a; int foo (int b) {
185  CFLAGS="$save_CFLAGS"
186  LDFLAGS="$save_LDFLAGS"])
187  AS_IF([test "x$ac_cv_tls" != xyes],
188 -      AC_MSG_ERROR([__thread support required]))
189 +      [AS_IF([test "$use_locks" = yes],
190 +            [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
191 +            [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
192 +                       [Stubbed out if missing compiler support.])])])
193  
194  dnl This test must come as early as possible after the compiler configuration
195  dnl tests, because the choice of the file model can (in principle) affect
196 @@ -251,7 +302,7 @@ AC_SUBST([eu_version])
197  
198  # 1.234<whatever> -> 1234<whatever>
199  case "$PACKAGE_VERSION" in
200 -[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
201 +[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
202  *)                AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
203  esac
204  case "$eu_version" in
205 @@ -280,6 +331,6 @@ case "$eu_version" in
206  esac
207  
208  # Round up to the next release API (x.y) version.
209 -[eu_version=$[($eu_version + 999) / 1000]]
210 +eu_version=`expr \( $eu_version + 999 \) / 1000`
211  
212  AC_OUTPUT
213 --- elfutils/lib/ChangeLog
214 +++ elfutils/lib/ChangeLog
215 @@ -14,6 +14,9 @@
216  
217  2009-01-23  Roland McGrath  <roland@redhat.com>
218  
219 +       * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
220 +       (__builtin_popcount): New inline function.
221 +
222         * eu-config.h: Add multiple inclusion protection.
223  
224  2009-01-17  Ulrich Drepper  <drepper@redhat.com>
225 @@ -70,6 +73,11 @@
226         * Makefile.am (libeu_a_SOURCES): Add it.
227         * system.h: Declare crc32_file.
228  
229 +2005-02-07  Roland McGrath  <roland@redhat.com>
230 +
231 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
232 +       (AM_CFLAGS): Use it in place of -Wextra.
233 +
234  2005-04-30  Ulrich Drepper  <drepper@redhat.com>
235  
236         * Makefile.am: Use -ffunction-sections for xmalloc.c.
237 --- elfutils/lib/eu-config.h
238 +++ elfutils/lib/eu-config.h
239 @@ -182,6 +182,17 @@ asm (".section predict_data, \"aw\"; .pr
240  /* This macro is used by the tests conditionalize for standalone building.  */
241  #define ELFUTILS_HEADER(name) <lib##name.h>
242  
243 +#ifndef HAVE_BUILTIN_POPCOUNT
244 +# define __builtin_popcount hakmem_popcount
245 +static inline unsigned int __attribute__ ((unused))
246 +hakmem_popcount (unsigned int x)
247 +{
248 +  /* HAKMEM 169 */
249 +  unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
250 +  return ((n + (n >> 3)) & 030707070707) % 63;
251 +}
252 +#endif /* HAVE_BUILTIN_POPCOUNT */
253 +
254  
255  #ifdef SHARED
256  # define OLD_VERSION(name, version) \
257 --- elfutils/libasm/ChangeLog
258 +++ elfutils/libasm/ChangeLog
259 @@ -67,6 +67,11 @@
260         * asm_error.c: Add new error ASM_E_IOERROR.
261         * libasmP.h: Add ASM_E_IOERROR definition.
262  
263 +2005-05-31  Roland McGrath  <roland@redhat.com>
264 +
265 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
266 +       (AM_CFLAGS): Use it in place of -Wextra.
267 +
268  2005-02-15  Ulrich Drepper  <drepper@redhat.com>
269  
270         * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
271 --- elfutils/libcpu/ChangeLog
272 +++ elfutils/libcpu/ChangeLog
273 @@ -15,6 +15,9 @@
274  
275  2009-01-23  Roland McGrath  <roland@redhat.com>
276  
277 +       * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
278 +       compilers that don't realize it's noreturn.
279 +
280         * Makefile.am (i386_parse_CFLAGS): Use quotes around command
281         substitution that can produce leading whitespace.
282  
283 @@ -344,6 +347,11 @@
284         * defs/i386.doc: New file.
285         * defs/x86_64: New file.
286  
287 +2005-04-04  Roland McGrath  <roland@redhat.com>
288 +
289 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
290 +       (AM_CFLAGS): Use it instead of -Wextra.
291 +
292  2005-02-15  Ulrich Drepper  <drepper@redhat.com>
293  
294         * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
295 --- elfutils/libcpu/i386_disasm.c
296 +++ elfutils/libcpu/i386_disasm.c
297 @@ -791,6 +791,7 @@ i386_disasm (const uint8_t **startp, con
298  
299                         default:
300                           assert (! "INVALID not handled");
301 +                         abort ();
302                         }
303                     }
304                   else
305 --- elfutils/libdw/ChangeLog
306 +++ elfutils/libdw/ChangeLog
307 @@ -308,6 +308,10 @@
308  
309         * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
310  
311 +2009-08-17  Roland McGrath  <roland@redhat.com>
312 +
313 +       * libdw.h: Disable extern inlines for GCC 4.2.
314 +
315  2009-08-10  Roland McGrath  <roland@redhat.com>
316  
317         * dwarf_getscopevar.c: Use dwarf_diename.
318 @@ -1076,6 +1080,11 @@
319  
320  2005-05-31  Roland McGrath  <roland@redhat.com>
321  
322 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
323 +       (AM_CFLAGS): Use it in place of -Wextra.
324 +
325 +2005-05-31  Roland McGrath  <roland@redhat.com>
326 +
327         * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
328         formref offset.
329  
330 --- elfutils/libdw/libdw.h
331 +++ elfutils/libdw/libdw.h
332 @@ -852,7 +852,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (
333  
334  
335  /* Inline optimizations.  */
336 -#ifdef __OPTIMIZE__
337 +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
338  /* Return attribute code of given attribute.  */
339  __libdw_extern_inline unsigned int
340  dwarf_whatattr (Dwarf_Attribute *attr)
341 --- elfutils/libdwfl/ChangeLog
342 +++ elfutils/libdwfl/ChangeLog
343 @@ -1350,6 +1350,11 @@
344  
345  2005-07-21  Roland McGrath  <roland@redhat.com>
346  
347 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
348 +       (AM_CFLAGS): Use it in place of -Wextra.
349 +
350 +2005-07-21  Roland McGrath  <roland@redhat.com>
351 +
352         * Makefile.am (noinst_HEADERS): Add loc2c.c.
353  
354         * test2.c (main): Check sscanf result to quiet warning.
355 --- elfutils/libebl/ChangeLog
356 +++ elfutils/libebl/ChangeLog
357 @@ -628,6 +628,11 @@
358         * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
359         tracking works right.
360  
361 +2005-05-31  Roland McGrath  <roland@redhat.com>
362 +
363 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
364 +       (AM_CFLAGS): Use it in place of -Wextra.
365 +
366  2005-05-21  Ulrich Drepper  <drepper@redhat.com>
367  
368         * libebl_x86_64.map: Add x86_64_core_note.
369 --- elfutils/libelf/ChangeLog
370 +++ elfutils/libelf/ChangeLog
371 @@ -671,6 +671,11 @@
372  
373         * elf.h: Update from glibc.
374  
375 +2005-05-31  Roland McGrath  <roland@redhat.com>
376 +
377 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
378 +       (AM_CFLAGS): Use it in place of -Wextra.
379 +
380  2005-05-08  Roland McGrath  <roland@redhat.com>
381  
382         * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
383 --- elfutils/libelf/common.h
384 +++ elfutils/libelf/common.h
385 @@ -160,7 +160,7 @@ libelf_release_all (Elf *elf)
386    (Var) = (sizeof (Var) == 1                                                 \
387            ? (unsigned char) (Var)                                            \
388            : (sizeof (Var) == 2                                               \
389 -             ? bswap_16 (Var)                                                \
390 +             ? (unsigned short int) bswap_16 (Var)                           \
391               : (sizeof (Var) == 4                                            \
392                  ? bswap_32 (Var)                                             \
393                  : bswap_64 (Var))))
394 @@ -169,7 +169,7 @@ libelf_release_all (Elf *elf)
395    (Dst) = (sizeof (Var) == 1                                                 \
396            ? (unsigned char) (Var)                                            \
397            : (sizeof (Var) == 2                                               \
398 -             ? bswap_16 (Var)                                                \
399 +             ? (unsigned short int) bswap_16 (Var)                           \
400               : (sizeof (Var) == 4                                            \
401                  ? bswap_32 (Var)                                             \
402                  : bswap_64 (Var))))
403 --- elfutils/src/addr2line.c
404 +++ elfutils/src/addr2line.c
405 @@ -455,10 +455,10 @@ handle_address (const char *string, Dwfl
406        bool parsed = false;
407        int i, j;
408        char *name = NULL;
409 -      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
410 +      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
411           && string[i] == '\0')
412         parsed = adjust_to_section (name, &addr, dwfl);
413 -      switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
414 +      switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
415         {
416         default:
417           break;
418 --- elfutils/src/ChangeLog
419 +++ elfutils/src/ChangeLog
420 @@ -236,8 +236,16 @@
421         * readelf.c (attr_callback): Use print_block only when we don't use
422         print_ops.
423  
424 +2009-08-17  Roland McGrath  <roland@redhat.com>
425 +
426 +       * ld.h: Disable extern inlines for GCC 4.2.
427 +
428  2009-08-14  Roland McGrath  <roland@redhat.com>
429  
430 +       * strings.c (read_block): Conditionalize posix_fadvise use
431 +       on [POSIX_FADV_SEQUENTIAL].
432 +       From Petr Salinger <Petr.Salinger@seznam.cz>.
433 +
434         * ar.c (do_oper_extract): Use pathconf instead of statfs.
435  
436  2009-08-01  Ulrich Drepper  <drepper@redhat.com>
437 @@ -401,6 +409,8 @@
438         * readelf.c (print_debug_frame_section): Use t instead of j formats
439         for ptrdiff_t OFFSET.
440  
441 +       * addr2line.c (handle_address): Use %a instead of %m for compatibility.
442 +
443  2009-01-21  Ulrich Drepper  <drepper@redhat.com>
444  
445         * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
446 @@ -584,6 +594,11 @@
447         that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
448         is valid in RELRO.
449  
450 +2008-03-01  Roland McGrath  <roland@redhat.com>
451 +
452 +       * readelf.c (dump_archive_index): Tweak portability hack
453 +       to match [__GNUC__ < 4] too.
454 +
455  2008-02-29  Roland McGrath  <roland@redhat.com>
456  
457         * readelf.c (print_attributes): Add a cast.
458 @@ -835,6 +850,8 @@
459  
460         * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
461  
462 +       * Makefile.am (readelf_no_Werror): New variable.
463 +
464  2007-10-15  Roland McGrath  <roland@redhat.com>
465  
466         * make-debug-archive.in: New file.
467 @@ -1274,6 +1291,10 @@
468         * elflint.c (valid_e_machine): Add EM_ALPHA.
469         Reported by Christian Aichinger <Greek0@gmx.net>.
470  
471 +       * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
472 +       MADV_SEQUENTIAL if undefined.   Don't call posix_madvise
473 +       if neither is defined.
474 +
475  2006-08-08  Ulrich Drepper  <drepper@redhat.com>
476  
477         * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
478 @@ -1350,6 +1371,10 @@
479         * Makefile.am: Add hacks to create dependency files for non-generic
480         linker.
481  
482 +2006-04-05  Roland McGrath  <roland@redhat.com>
483 +
484 +       * strings.c (MAP_POPULATE): Define to 0 if undefined.
485 +
486  2006-06-12  Ulrich Drepper  <drepper@redhat.com>
487  
488         * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
489 @@ -1698,6 +1723,11 @@
490         * readelf.c (print_debug_loc_section): Fix indentation for larger
491         address size.
492  
493 +2005-05-31  Roland McGrath  <roland@redhat.com>
494 +
495 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
496 +       (AM_CFLAGS): Use it in place of -Wextra.
497 +
498  2005-05-30  Roland McGrath  <roland@redhat.com>
499  
500         * readelf.c (print_debug_line_section): Print section offset of each
501 --- elfutils/src/findtextrel.c
502 +++ elfutils/src/findtextrel.c
503 @@ -504,7 +504,11 @@ ptrcompare (const void *p1, const void *
504  
505  
506  static void
507 -check_rel (size_t nsegments, struct segments segments[nsegments],
508 +check_rel (size_t nsegments, struct segments segments[
509 +#if __GNUC__ >= 4
510 +                                                     nsegments
511 +#endif
512 +          ],
513            GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
514            const char *fname, bool more_than_one, void **knownsrcs)
515  {
516 --- elfutils/src/ld.h
517 +++ elfutils/src/ld.h
518 @@ -1122,6 +1122,7 @@ extern bool dynamically_linked_p (void);
519  
520  /* Checked whether the symbol is undefined and referenced from a DSO.  */
521  extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
522 +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
523  #ifdef __GNUC_STDC_INLINE__
524  __attribute__ ((__gnu_inline__))
525  #endif
526 @@ -1139,5 +1140,6 @@ linked_from_dso_p (struct scninfo *scnin
527  
528    return sym->defined && sym->in_dso;
529  }
530 +#endif /* Optimizing and not GCC 4.2.  */
531  
532  #endif /* ld.h */
533 --- elfutils/src/Makefile.am
534 +++ elfutils/src/Makefile.am
535 @@ -99,6 +99,9 @@ addr2line_no_Wformat = yes
536  # XXX While the file is not finished, don't warn about this
537  ldgeneric_no_Wunused = yes
538  
539 +# Buggy old compilers.
540 +readelf_no_Werror = yes
541 +
542  readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
543  nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
544  size_LDADD = $(libelf) $(libeu) $(libmudflap)
545 --- elfutils/src/readelf.c
546 +++ elfutils/src/readelf.c
547 @@ -4274,10 +4274,11 @@ struct listptr
548  #define listptr_offset_size(p) ((p)->dwarf64 ? 8 : 4)
549  #define listptr_address_size(p)        ((p)->addr64 ? 8 : 4)
550  
551 +static const char *listptr_name;
552  static int
553 -compare_listptr (const void *a, const void *b, void *arg)
554 +compare_listptr (const void *a, const void *b)
555  {
556 -  const char *name = arg;
557 +  const char *const name = listptr_name;
558    struct listptr *p1 = (void *) a;
559    struct listptr *p2 = (void *) b;
560  
561 @@ -4357,8 +4358,11 @@ static void
562  sort_listptr (struct listptr_table *table, const char *name)
563  {
564    if (table->n > 0)
565 -    qsort_r (table->table, table->n, sizeof table->table[0],
566 -            &compare_listptr, (void *) name);
567 +    {
568 +      listptr_name = name;
569 +      qsort (table->table, table->n, sizeof table->table[0],
570 +            &compare_listptr);
571 +    }
572  }
573  
574  static bool
575 @@ -8098,7 +8102,7 @@ dump_archive_index (Elf *elf, const char
576           if (unlikely (elf_rand (elf, as_off) == 0)
577               || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
578                            == NULL))
579 -#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
580 +#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
581             while (1)
582  #endif
583               error (EXIT_FAILURE, 0,
584 --- elfutils/src/strings.c
585 +++ elfutils/src/strings.c
586 @@ -51,6 +51,10 @@
587  
588  #include <system.h>
589  
590 +#ifndef MAP_POPULATE
591 +# define MAP_POPULATE 0
592 +#endif
593 +
594  
595  /* Prototypes of local functions.  */
596  static int read_fd (int fd, const char *fname, off64_t fdlen);
597 @@ -491,8 +495,13 @@ map_file (int fd, off64_t start_off, off
598                     fd, start_off);
599        if (mem != MAP_FAILED)
600         {
601 +#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
602 +# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
603 +#endif
604 +#ifdef POSIX_MADV_SEQUENTIAL
605           /* We will go through the mapping sequentially.  */
606           (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
607 +#endif
608           break;
609         }
610        if (errno != EINVAL && errno != ENOMEM)
611 @@ -584,9 +593,11 @@ read_block (int fd, const char *fname, o
612        elfmap_off = from & ~(ps - 1);
613        elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
614  
615 +#ifdef POSIX_FADV_SEQUENTIAL
616        if (unlikely (elfmap == MAP_FAILED))
617         /* Let the kernel know we are going to read everything in sequence.  */
618         (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
619 +#endif
620      }
621  
622    if (unlikely (elfmap == MAP_FAILED))
623 --- elfutils/src/strip.c
624 +++ elfutils/src/strip.c
625 @@ -53,6 +53,12 @@
626  #include <libebl.h>
627  #include <system.h>
628  
629 +#ifdef HAVE_FUTIMES
630 +# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
631 +#else
632 +# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
633 +#endif
634 +
635  
636  /* Name and version of program.  */
637  static void print_version (FILE *stream, struct argp_state *state);
638 @@ -311,8 +317,18 @@ process_file (const char *fname)
639  
640        /* If we have to preserve the timestamp, we need it in the
641          format utimes() understands.  */
642 +#ifdef HAVE_STRUCT_STAT_ST_ATIM
643        TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
644 +#else
645 +      tv[0].tv_sec = pre_st.st_atime;
646 +      tv[0].tv_usec = 0;
647 +#endif
648 +#ifdef HAVE_STRUCT_STAT_ST_MTIM
649        TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
650 +#else
651 +      tv[1].tv_sec = pre_st.st_atime;
652 +      tv[1].tv_usec = 0;
653 +#endif
654      }
655  
656    /* Open the file.  */
657 @@ -1809,7 +1825,7 @@ while computing checksum for debug infor
658    /* If requested, preserve the timestamp.  */
659    if (tvp != NULL)
660      {
661 -      if (futimes (fd, tvp) != 0)
662 +      if (FUTIMES (fd, output_fname, tvp) != 0)
663         {
664           error (0, errno, gettext ("\
665  cannot set access and modification date of '%s'"),
666 @@ -1866,7 +1882,7 @@ handle_ar (int fd, Elf *elf, const char 
667  
668    if (tvp != NULL)
669      {
670 -      if (unlikely (futimes (fd, tvp) != 0))
671 +      if (unlikely (FUTIMES (fd, fname, tvp) != 0))
672         {
673           error (0, errno, gettext ("\
674  cannot set access and modification date of '%s'"), fname);
675 --- elfutils/tests/ChangeLog
676 +++ elfutils/tests/ChangeLog
677 @@ -197,6 +197,8 @@
678  
679  2008-01-21  Roland McGrath  <roland@redhat.com>
680  
681 +       * line2addr.c (main): Revert last change.
682 +
683         * testfile45.S.bz2: Add tests for cltq, cqto.
684         * testfile45.expect.bz2: Adjust.
685  
686 @@ -905,6 +907,11 @@
687         * Makefile.am (TESTS): Add run-elflint-test.sh.
688         (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
689  
690 +2005-05-31  Roland McGrath  <roland@redhat.com>
691 +
692 +       * Makefile.am (WEXTRA): New variable, substituted by configure.
693 +       (AM_CFLAGS): Use it in place of -Wextra.
694 +
695  2005-05-24  Ulrich Drepper  <drepper@redhat.com>
696  
697         * get-files.c (main): Use correct format specifier.
698 --- elfutils/tests/line2addr.c
699 +++ elfutils/tests/line2addr.c
700 @@ -132,7 +132,7 @@ main (int argc, char *argv[])
701      {
702        struct args a = { .arg = argv[cnt] };
703  
704 -      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
705 +      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
706         {
707         default:
708         case 0:
This page took 0.139938 seconds and 3 git commands to generate.