+2007-08-13 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
+
+2007-08-12 Roland McGrath <roland@redhat.com>
+
+ * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
+ FTS_LOGICAL.
+
+ * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
+ a second phdr if it happens to match EHDR_VMA exactly.
+
2007-08-08 Roland McGrath <roland@redhat.com>
* dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
/* Keep track of an eligible symbol with st_size == 0 as a fallback. */
const char *sizeless_name = NULL;
- GElf_Sym sizeless_sym;
+ GElf_Sym sizeless_sym = { 0, 0, 0, 0, 0, SHN_UNDEF };
GElf_Word sizeless_shndx = SHN_UNDEF;
- sizeless_sym.st_value = 0;
/* Keep track of the lowest address a relevant sizeless symbol could have. */
GElf_Addr min_label = addr;
size_t contents_size = 0;
GElf_Off segments_end = 0;
GElf_Addr loadbase = ehdr_vma;
+ bool found_base = false;
switch (ehdr.e32.e_ident[EI_CLASS])
{
inline void handle_segment (GElf_Addr vaddr, GElf_Off offset,
if (segment_end > (GElf_Off) contents_size)
contents_size = segment_end;
- if ((offset & -align) == 0 && loadbase == ehdr_vma)
- loadbase = ehdr_vma - (vaddr & -align);
+ if (!found_base && (offset & -align) == 0)
+ {
+ loadbase = ehdr_vma - (vaddr & -align);
+ found_base = true;
+ }
segments_end = offset + filesz;
}
return errno;
}
- FTS *fts = fts_open (modulesdir, FTS_LOGICAL | FTS_NOSTAT, NULL);
+ FTS *fts = fts_open (modulesdir, FTS_NOSTAT, NULL);
if (modulesdir[0] == (char *) release)
modulesdir[0] = NULL;
if (fts == NULL)
if (asprintf (&modulesdir[0], MODULEDIRFMT, release) < 0)
return -1;
- FTS *fts = fts_open (modulesdir, FTS_LOGICAL | FTS_NOSTAT, NULL);
+ FTS *fts = fts_open (modulesdir, FTS_NOSTAT, NULL);
if (fts == NULL)
{
free (modulesdir[0]);
+2007-08-12 Roland McGrath <roland@redhat.com>
+
+ * elf32_updatefile.c (compare_sections): Sort secondarily on sh_size,
+ and only tertiarily on index.
+
2007-07-09 Roland McGrath <roland@redhat.com>
* elf.h: Update from glibc.
/* Write changed data structures.
- Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
> (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_offset)
return 1;
+ if ((*scna)->shdr.ELFW(e,LIBELFBITS)->sh_size
+ < (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_size)
+ return -1;
+
+ if ((*scna)->shdr.ELFW(e,LIBELFBITS)->sh_size
+ > (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_size)
+ return 1;
+
if ((*scna)->index < (*scnb)->index)
return -1;
/* Insert the sections in the list into the provided array and sort
them according to their start offsets. For sections with equal
- start offsets the section index is used. */
+ start offsets, the size is used; for sections with equal start
+ offsets and sizes, the section index is used. Sorting by size
+ ensures that zero-length sections are processed first, which
+ is what we want since they do not advance our file writing position. */
static void
sort_sections (Elf_Scn **scns, Elf_ScnList *list)
{
sizeof (ElfW2(LIBELFBITS,Shdr)));
shdr_flags |= scn->shdr_flags;
- scn->shdr_flags &= ~ELF_F_DIRTY;
+ scn->shdr_flags &= ~ELF_F_DIRTY;
}
/* Fill the gap between last section and section header table if
+2007-08-12 Roland McGrath <roland@redhat.com>
+
+ * elflint.c (check_note): Accept type 0 with name "Linux".
+
+ * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
+
+ * elflint.c (section_flags_string): Return "none" for 0, not "".
+
2007-08-11 Roland McGrath <roland@redhat.com>
* elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
static const char *
section_flags_string (GElf_Word flags, char *buf, size_t len)
{
+ if (flags == 0)
+ return "none";
+
static const struct
{
GElf_Word flag;
{ ".init_array", 12, SHT_INIT_ARRAY, exact, SHF_ALLOC | SHF_WRITE, 0 },
{ ".interp", 8, SHT_PROGBITS, atleast, 0, SHF_ALLOC }, // XXX more tests?
{ ".line", 6, SHT_PROGBITS, exact, 0, 0 },
- { ".note", 6, SHT_NOTE, exact, 0, 0 },
+ { ".note", 6, SHT_NOTE, atleast, 0, SHF_ALLOC },
{ ".plt", 5, SHT_PROGBITS, unused, 0, 0 }, // XXX more tests
{ ".preinit_array", 15, SHT_PREINIT_ARRAY, exact, SHF_ALLOC | SHF_WRITE, 0 },
{ ".rela", 5, SHT_RELA, atleast, 0, SHF_ALLOC }, // XXX more tests
/* Known type. */
break;
+ case 0:
+ /* Linux vDSOs use a type 0 note for the kernel version word. */
+ if (namesz == sizeof "Linux"
+ && !memcmp (notemem + idx + 3 * align, "Linux", sizeof "Linux"))
+ break;
+
default:
ERROR (gettext ("\
phdr[%d]: unknown object file note type %" PRIu64 " at offset %" PRIu64 "\n"),
+2007-08-12 Roland McGrath <roland@redhat.com>
+
+ * run-strip-test7.sh: New file.
+ * testfile39.bz2: New data file.
+ * testfile40.bz2: New data file.
+ * testfile40.debug.bz2: New data file.
+ * Makefile.am (TESTS, EXTRA_DIST): Add them.
+
2007-08-09 Roland McGrath <roland@redhat.com>
* dwfl-bug-report.c: Fix header inclusion.
run-show-abbrev.sh run-line2addr.sh hash \
newscn run-strip-test.sh run-strip-test2.sh \
run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
- run-strip-test6.sh run-unstrip-test.sh run-unstrip-test2.sh \
+ run-strip-test6.sh run-strip-test7.sh \
+ run-unstrip-test.sh run-unstrip-test2.sh \
run-ecp-test.sh run-ecp-test2.sh \
run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \
run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh \
testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
- run-unstrip-test.sh run-unstrip-test2.sh \
+ run-strip-test7.sh run-unstrip-test.sh run-unstrip-test2.sh \
run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
run-ranlib-test3.sh run-ranlib-test4.sh \
run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
testfile34.bz2 testfile35.bz2 testfile35.debug.bz2 \
testfile36.bz2 testfile36.debug.bz2 \
testfile37.bz2 testfile37.debug.bz2 \
- testfile38.bz2
+ testfile38.bz2 testfile39.bz2 testfile40.bz2 testfile40.debug.bz2
installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
bindir=$(DESTDIR)$(bindir) \
--- /dev/null
+original=testfile39
+stripped=testfile40
+debugfile=testfile40.debug
+
+. $srcdir/run-strip-test.sh