summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog30
-rw-r--r--src/Makefile.am5
-rw-r--r--src/addr2line.c4
-rw-r--r--src/ar.c7
-rw-r--r--src/findtextrel.c6
-rw-r--r--src/ld.h2
-rw-r--r--src/readelf.c15
-rw-r--r--src/strings.c11
-rw-r--r--src/strip.c14
9 files changed, 86 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 15e6faea..78535c8e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1598,8 +1598,16 @@
* readelf.c (attr_callback): Use print_block only when we don't use
print_ops.
+2009-08-17 Roland McGrath <[email protected]>
+
+ * ld.h: Disable extern inlines for GCC 4.2.
+
2009-08-14 Roland McGrath <[email protected]>
+ * strings.c (read_block): Conditionalize posix_fadvise use
+ on [POSIX_FADV_SEQUENTIAL].
+ From Petr Salinger <[email protected]>.
+
* ar.c (do_oper_extract): Use pathconf instead of statfs.
2009-08-01 Ulrich Drepper <[email protected]>
@@ -1763,6 +1771,8 @@
* readelf.c (print_debug_frame_section): Use t instead of j formats
for ptrdiff_t OFFSET.
+ * addr2line.c (handle_address): Use %a instead of %m for compatibility.
+
2009-01-21 Ulrich Drepper <[email protected]>
* elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
@@ -1946,6 +1956,11 @@
that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
is valid in RELRO.
+2008-03-01 Roland McGrath <[email protected]>
+
+ * readelf.c (dump_archive_index): Tweak portability hack
+ to match [__GNUC__ < 4] too.
+
2008-02-29 Roland McGrath <[email protected]>
* readelf.c (print_attributes): Add a cast.
@@ -2197,6 +2212,8 @@
* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
+ * Makefile.am (readelf_no_Werror): New variable.
+
2007-10-15 Roland McGrath <[email protected]>
* make-debug-archive.in: New file.
@@ -2636,6 +2653,10 @@
* elflint.c (valid_e_machine): Add EM_ALPHA.
Reported by Christian Aichinger <[email protected]>.
+ * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
+ MADV_SEQUENTIAL if undefined. Don't call posix_madvise
+ if neither is defined.
+
2006-08-08 Ulrich Drepper <[email protected]>
* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
@@ -2712,6 +2733,10 @@
* Makefile.am: Add hacks to create dependency files for non-generic
linker.
+2006-04-05 Roland McGrath <[email protected]>
+
+ * strings.c (MAP_POPULATE): Define to 0 if undefined.
+
2006-06-12 Ulrich Drepper <[email protected]>
* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
@@ -3060,6 +3085,11 @@
* readelf.c (print_debug_loc_section): Fix indentation for larger
address size.
+2005-05-31 Roland McGrath <[email protected]>
+
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
+ (AM_CFLAGS): Use it in place of -Wextra.
+
2005-05-30 Roland McGrath <[email protected]>
* readelf.c (print_debug_line_section): Print section offset of each
diff --git a/src/Makefile.am b/src/Makefile.am
index cd2755b0..f72c3a84 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -90,6 +90,11 @@ endif
ldgeneric_no_Wunused = yes
ldgeneric_no_Wstack_usage = yes
+# Buggy old compilers or libc headers.
+readelf_no_Werror = yes
+strings_no_Werror = yes
+addr2line_no_Wformat = yes
+
# Bad, bad stack usage...
readelf_no_Wstack_usage = yes
nm_no_Wstack_usage = yes
diff --git a/src/addr2line.c b/src/addr2line.c
index 0ce854f6..d2d0c8c0 100644
--- a/src/addr2line.c
+++ b/src/addr2line.c
@@ -622,10 +622,10 @@ handle_address (const char *string, Dwfl *dwfl)
bool parsed = false;
int i, j;
char *name = NULL;
- if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+ if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
&& string[i] == '\0')
parsed = adjust_to_section (name, &addr, dwfl);
- switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+ switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
{
default:
break;
diff --git a/src/ar.c b/src/ar.c
index 1320d07b..f1f1533e 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -685,7 +685,14 @@ do_oper_extract (int oper, const char *arfname, char **argv, int argc,
tv[1].tv_sec = arhdr->ar_date;
tv[1].tv_nsec = 0;
+#ifdef HAVE_FUTIMENS
if (unlikely (futimens (xfd, tv) != 0))
+#else
+ struct timeval times[2];
+ TIMESPEC_TO_TIMEVAL (&times[0], &tv[0]);
+ TIMESPEC_TO_TIMEVAL (&times[1], &tv[1]);
+ if (unlikely (futimes (xfd, times) != 0))
+#endif
{
error (0, errno,
gettext ("cannot change modification time of %s"),
diff --git a/src/findtextrel.c b/src/findtextrel.c
index 264a06bd..d7de202b 100644
--- a/src/findtextrel.c
+++ b/src/findtextrel.c
@@ -502,7 +502,11 @@ ptrcompare (const void *p1, const void *p2)
static void
-check_rel (size_t nsegments, struct segments segments[nsegments],
+check_rel (size_t nsegments, struct segments segments[
+#if __GNUC__ >= 4
+ nsegments
+#endif
+ ],
GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
const char *fname, bool more_than_one, void **knownsrcs)
{
diff --git a/src/ld.h b/src/ld.h
index 29f4031b..8695c31b 100644
--- a/src/ld.h
+++ b/src/ld.h
@@ -1114,6 +1114,7 @@ extern bool dynamically_linked_p (void);
/* Checked whether the symbol is undefined and referenced from a DSO. */
extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
#ifdef __GNUC_STDC_INLINE__
__attribute__ ((__gnu_inline__))
#endif
@@ -1131,5 +1132,6 @@ linked_from_dso_p (struct scninfo *scninfo, size_t symidx)
return sym->defined && sym->in_dso;
}
+#endif /* Optimizing and not GCC 4.2. */
#endif /* ld.h */
diff --git a/src/readelf.c b/src/readelf.c
index b4cb3a82..606d2203 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -4364,10 +4364,12 @@ listptr_base (struct listptr *p)
return base;
}
+static const char *listptr_name;
+
static int
-compare_listptr (const void *a, const void *b, void *arg)
+compare_listptr (const void *a, const void *b)
{
- const char *name = arg;
+ const char *const name = listptr_name;
struct listptr *p1 = (void *) a;
struct listptr *p2 = (void *) b;
@@ -4463,8 +4465,11 @@ static void
sort_listptr (struct listptr_table *table, const char *name)
{
if (table->n > 0)
- qsort_r (table->table, table->n, sizeof table->table[0],
- &compare_listptr, (void *) name);
+ {
+ listptr_name = name;
+ qsort (table->table, table->n, sizeof table->table[0],
+ &compare_listptr);
+ }
}
static bool
@@ -9561,7 +9566,7 @@ dump_archive_index (Elf *elf, const char *fname)
if (unlikely (elf_rand (elf, as_off) == 0)
|| unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
== NULL))
-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
while (1)
#endif
error (EXIT_FAILURE, 0,
diff --git a/src/strings.c b/src/strings.c
index b2bce7b4..fe0ab6ce 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -43,6 +43,10 @@
#include <system.h>
+#ifndef MAP_POPULATE
+# define MAP_POPULATE 0
+#endif
+
/* Prototypes of local functions. */
static int read_fd (int fd, const char *fname, off64_t fdlen);
@@ -489,8 +493,13 @@ map_file (int fd, off64_t start_off, off64_t fdlen, size_t *map_sizep)
fd, start_off);
if (mem != MAP_FAILED)
{
+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
+#endif
+#ifdef POSIX_MADV_SEQUENTIAL
/* We will go through the mapping sequentially. */
(void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
+#endif
break;
}
if (errno != EINVAL && errno != ENOMEM)
@@ -581,9 +590,11 @@ read_block (int fd, const char *fname, off64_t fdlen, off64_t from, off64_t to)
elfmap_off = from & ~(ps - 1);
elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
+#ifdef POSIX_FADV_SEQUENTIAL
if (unlikely (elfmap == MAP_FAILED))
/* Let the kernel know we are going to read everything in sequence. */
(void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+#endif
}
if (unlikely (elfmap == MAP_FAILED))
diff --git a/src/strip.c b/src/strip.c
index 5e69334b..2028eb8b 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -2191,7 +2191,14 @@ while computing checksum for debug information"));
/* If requested, preserve the timestamp. */
if (tvp != NULL)
{
+#ifdef HAVE_FUTIMENS
if (futimens (fd, tvp) != 0)
+#else
+ struct timeval times[2];
+ TIMESPEC_TO_TIMEVAL (&times[0], &tvp[0]);
+ TIMESPEC_TO_TIMEVAL (&times[1], &tvp[1]);
+ if (futimes (fd, times) != 0)
+#endif
{
error (0, errno, gettext ("\
cannot set access and modification date of '%s'"),
@@ -2263,7 +2270,14 @@ handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
if (tvp != NULL)
{
+#ifdef HAVE_FUTIMENS
if (unlikely (futimens (fd, tvp) != 0))
+#else
+ struct timeval times[2];
+ TIMESPEC_TO_TIMEVAL (&times[0], &tvp[0]);
+ TIMESPEC_TO_TIMEVAL (&times[1], &tvp[1]);
+ if (unlikely (futimes (fd, times) != 0))
+#endif
{
error (0, errno, gettext ("\
cannot set access and modification date of '%s'"), fname);