summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2006-12-17 23:56:51 +0000
committerRoland McGrath <roland@redhat.com>2006-12-17 23:56:51 +0000
commit8190db6a86a37aec86c81626ab1b083c96aff891 (patch)
tree2b065733f6ee44885a447e9506fae59518076048
parent7c0e79ffc201e4828a050b35f2c9d96e3001cb48 (diff)
downloadelfutils-8190db6a86a37aec86c81626ab1b083c96aff891.tar.gz
propagate from branch 'com.redhat.elfutils' (head b4944cf70801d9dac056f4f80ef1334e5acb8bdc)
to branch 'com.redhat.elfutils.roland.pending' (head e7e402c668fb0670fc5f6b6a522853ae88f32f11)
-rw-r--r--ChangeLog4
-rw-r--r--Makefile.am2
-rw-r--r--libdw/ChangeLog5
-rw-r--r--libdw/dwarf_getlocation.c10
-rw-r--r--libdwfl/ChangeLog4
-rw-r--r--libdwfl/dwfl_module.c2
-rw-r--r--libelf/ChangeLog7
-rw-r--r--libelf/elf32_updatenull.c6
-rw-r--r--libelf/elf_error.c6
-rw-r--r--src/ChangeLog13
-rw-r--r--src/Makefile.am6
-rw-r--r--src/elflint.c3
-rw-r--r--src/strip.c4
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/msg_tst.c4
15 files changed, 61 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index a4eb6e48..760c4d2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-11-02 Roland McGrath <roland@redhat.com>
+
+ * Makefile.am (EXTRA_DIST): Add EXCEPTION file.
+
2006-08-29 Roland McGrath <roland@redhat.com>
* configure.ac: Use AM_MAINTAINER_MODE.
diff --git a/Makefile.am b/Makefile.am
index 8e8b1f75..9bfce658 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,7 +32,7 @@ mini_SUBDIRS = config m4 lib libelf libelf-po
all_SUBDIRS = libebl libdwfl libdw libcpu libasm backends src po tests
SUBDIRS = $(mini_SUBDIRS) $(all_SUBDIRS)
-EXTRA_DIST = elfutils.spec GPG-KEY NOTES
+EXTRA_DIST = elfutils.spec GPG-KEY NOTES EXCEPTION
# Make sure the test install uses lib64 when $LIB will yield lib64.
# Make sure the test build uses the same compiler, which on e.g. ppc64
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 88a0c06d..19c5d11b 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-17 Roland McGrath <roland@redhat.com>
+
+ * dwarf_getlocation.c (dwarf_getlocation_addr): Use zero as base
+ address when the CU is missing attributes due to buggy GCC.
+
2006-08-29 Roland McGrath <roland@redhat.com>
* Makefile.am (CLEANFILES): Add libdw.so.$(VERSION).
diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c
index f513f3ae..cefd052b 100644
--- a/libdw/dwarf_getlocation.c
+++ b/libdw/dwarf_getlocation.c
@@ -1,5 +1,5 @@
/* Return location expression list.
- Copyright (C) 2000, 2001, 2002, 2004, 2005 Red Hat, Inc.
+ Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -472,8 +472,12 @@ dwarf_getlocation_addr (attr, address, llbufs, listlens, maxlocs)
&base) != 0)
{
if (INTUSE(dwarf_errno) () == 0)
- goto invalid;
- return -1;
+ /* The compiler provided no base address when it should
+ have. Buggy GCC does this when it used absolute
+ addresses in the location list and no DW_AT_ranges. */
+ base = 0;
+ else
+ return -1;
}
}
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 7dea9438..f70c3397 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,7 @@
+2006-10-30 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module.c (dwfl_report_module): Comment typo fix.
+
2006-09-05 Roland McGrath <roland@redhat.com>
* derelocate.c (cache_sections): Use alloca instead of variable-sized
diff --git a/libdwfl/dwfl_module.c b/libdwfl/dwfl_module.c
index 3ccf8b16..5990b755 100644
--- a/libdwfl/dwfl_module.c
+++ b/libdwfl/dwfl_module.c
@@ -109,7 +109,7 @@ dwfl_report_begin (Dwfl *dwfl)
}
INTDEF (dwfl_report_begin)
-/* Report that a module called NAME pans addresses [START, END).
+/* Report that a module called NAME spans addresses [START, END).
Returns the module handle, either existing or newly allocated,
or returns a null pointer for an allocation error. */
Dwfl_Module *
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 81c6057c..9ff24df2 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-13 Roland McGrath <roland@redhat.com>
+
+ * elf32_updatenull.c: Look for phdr if e_phnum nonzero, regardless of
+ e_type. Diagnose ELF_E_INVALID_PHDR only for ET_REL, and not
+ if ELF_F_PERMISSIVE.
+ * elf_error.c (msgstr): Change ELF_E_INVALID_PHDR string.
+
2006-08-29 Roland McGrath <roland@redhat.com>
* elf32_getphdr.c: Don't byteswap phdr fields when EI_DATA matches
diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
index 3b926c1f..0de48bea 100644
--- a/libelf/elf32_updatenull.c
+++ b/libelf/elf32_updatenull.c
@@ -147,13 +147,13 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf, int *change_bop, size_t shnum)
off_t size = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1);
/* Set the program header position. */
- if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL
- && (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN))
+ if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL && ehdr->e_phnum != 0)
(void) INTUSE(elfw2(LIBELFBITS,getphdr)) (elf);
if (elf->state.ELFW(elf,LIBELFBITS).phdr != NULL)
{
/* Only executables or shared objects have a program header. */
- if (ehdr->e_type != ET_EXEC && unlikely (ehdr->e_type != ET_DYN))
+ if (unlikely (ehdr->e_type == ET_REL)
+ && (elf->flags & ELF_F_PERMISSIVE) == 0)
{
__libelf_seterrno (ELF_E_INVALID_PHDR);
return -1;
diff --git a/libelf/elf_error.c b/libelf/elf_error.c
index eb277e72..3161b8b8 100644
--- a/libelf/elf_error.c
+++ b/libelf/elf_error.c
@@ -1,5 +1,5 @@
/* Error handling in libelf.
- Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005 Red Hat, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -270,11 +270,11 @@ static const char msgstr[] =
#define ELF_E_INVALID_PHDR_IDX \
(ELF_E_GROUP_NOT_REL_IDX \
+ sizeof "only relocatable files can contain section groups")
- N_("program header only allowed in executables and shared objects")
+ N_("program header not allowed in relocatable files")
"\0"
#define ELF_E_NO_PHDR_IDX \
(ELF_E_INVALID_PHDR_IDX \
- + sizeof "program header only allowed in executables and shared objects")
+ + sizeof "program header not allowed in relocatable files")
N_("file has no program header")
"\0"
#define ELF_E_INVALID_OFFSET_IDX \
diff --git a/src/ChangeLog b/src/ChangeLog
index e89f6c0b..190c6732 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -4,6 +4,19 @@
two hash tables have different content (module expected omission
of undefined symbols).
+2006-10-31 Roland McGrath <roland@redhat.com>
+
+ * elflint.c (check_program_header): Don't complain about
+ p_filesz > p_memsz if p_memsz is zero and p_type is not PT_LOAD.
+
+2006-09-19 Jakub Jelinek <jakub@redhat.com>
+
+ * strip.c (process_file): Disallow -f on archives.
+
+2006-10-09 Roland McGrath <roland@redhat.com>
+
+ * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
+
2006-08-29 Roland McGrath <roland@redhat.com>
* Makefile.am (MAINTAINERCLEANFILES): New variable.
diff --git a/src/Makefile.am b/src/Makefile.am
index 470a6b3a..7c9eb842 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -133,9 +133,9 @@ am_libld_elf_i386_pic_a_OBJECTS = i386_ld.os
libld_elf_i386_so_SOURCES =
libld_elf_i386.so: libld_elf_i386_pic.a libld_elf_i386.map
- $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- $(libelf) $(libeu) \
- -Wl,--version-script,$(srcdir)/libld_elf_i386.map
+ $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
+ $(libelf) $(libeu) \
+ -Wl,--version-script,$(srcdir)/libld_elf_i386.map
$(textrel_check)
endif
diff --git a/src/elflint.c b/src/elflint.c
index e5917392..06930ca8 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -3829,7 +3829,8 @@ loadable segment GNU_RELRO applies to is executable\n"));
program header offset in ELF header and PHDR entry do not match"));
}
- if (phdr->p_filesz > phdr->p_memsz)
+ if (phdr->p_filesz > phdr->p_memsz
+ && (phdr->p_memsz != 0 || phdr->p_type == PT_LOAD))
ERROR (gettext ("\
program header entry %d: file size greater than memory size\n"),
cnt);
diff --git a/src/strip.c b/src/strip.c
index fc6ddf50..4c6b7bfb 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -344,9 +344,9 @@ process_file (const char *fname)
case ELF_K_AR:
/* It is not possible to strip the content of an archive direct
the output to a specific file. */
- if (unlikely (output_fname != NULL))
+ if (unlikely (output_fname != NULL || debug_fname != NULL))
{
- error (0, 0, gettext ("%s: cannot use -o when stripping archive"),
+ error (0, 0, gettext ("%s: cannot use -o or -f when stripping archive"),
fname);
result = 1;
}
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 44b0bb4a..372ff7eb 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2006-12-17 Roland McGrath <roland@redhat.com>
+
+ * msg_tst.c (libelf_msgs): Fix ELF_E_INVALID_PHDR msg.
+
2006-09-05 Roland McGrath <roland@redhat.com>
* run-strings-test.sh: Export LC_ALL=C for the test.
diff --git a/tests/msg_tst.c b/tests/msg_tst.c
index a432b6c4..36debbe4 100644
--- a/tests/msg_tst.c
+++ b/tests/msg_tst.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2005 Red Hat, Inc.
+/* Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -79,7 +79,7 @@ static struct
{ ELF_E_GROUP_NOT_REL,
"only relocatable files can contain section groups" },
{ ELF_E_INVALID_PHDR,
- "program header only allowed in executables and shared objects" },
+ "program header not allowed in relocatable files" },
{ ELF_E_NO_PHDR, "file has no program header" },
{ ELF_E_INVALID_OFFSET, "invalid offset" }
};