dnl by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
dnl 3001 King Ranch Road, Ukiah, CA 95482.
dnl
-AC_INIT([elfutils],[0.76],[drepper@redhat.com],[elfutils])
-AM_INIT_AUTOMAKE([gnits 1.6.3 dist-bzip2])
+AC_INIT([elfutils],[0.78],[drepper@redhat.com],[elfutils])
+AM_INIT_AUTOMAKE([gnits 1.7 dist-bzip2])
AC_COPYRIGHT([Copyright (C) 1996-2002, 2003 Red Hat, Inc.])
AC_CONFIG_SRCDIR([src/readelf.c])
AM_CONFIG_HEADER([config.h])
/* Store the real section index in the extended setion
index table. */
- assert (ptr < ctx->nsymbol_tab + 1);
+ assert ((size_t) ptr < ctx->nsymbol_tab + 1);
xshndx[ptr] = ndx;
/* And signal that this happened. */
## Process this file with automake to create Makefile.in
## Configure input file for elfutils.
##
-## Copyright (C) 2002 Red Hat, Inc.
+## Copyright (C) 2002, 2003 Red Hat, Inc.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License version 2 as
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
AM_CFLAGS = -Wall -Wshadow # -Werror
INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
+VERSION = 1
LINT = splint
#euinclude_HEADERS = libdw.h
libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_get_elf.c \
- dwarf_get_pubnames.c \
- dwarf_error.c
+ dwarf_get_pubnames.c dwarf_get_abbrev.c dwarf_tag.c \
+ dwarf_error.c dwarf_nextcu.c dwarf_diename.c dwarf_offdie.c \
+ dwarf_attr.c dwarf_formstring.c dwarf_abbrev_hash.c \
+ dwarf_child.c dwarf_has_children.c dwarf_formaddr.c \
+ dwarf_formudata.c dwarf_formsdata.c dwarf_lowpc.c \
+ dwarf_highpc.c dwarf_formref.c dwarf_siblingof.c \
+ libdw_findcu.c libdw_form.c libdw_alloc.c
+
libdw_pic_a_SOURCES =
am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
libdw.so: libdw_pic.a $(srcdir)/libdw.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
-Wl,--version-script,$(srcdir)/libdw.map,--no-undefined \
- -Wl,--soname,$@.$(VERSION) \
+ -Wl,--soname,$@.$(VERSION),-z,defs \
../libelf/libelf.so
ln -fs $@ $@.$(VERSION)
# rm -f $(DESTDIR)$(libdir)/libdw.so
# rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
-noinst_HEADERS = libdwP.h memory-access.h \
+noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h \
dwarf.h libdw.h
EXTRA_DIST = libdw.map
/* Create descriptor from ELF descriptor for processing file.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2003 Red Hat, Inc.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
This program is free software; you can redistribute it and/or modify
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <sys/stat.h>
#include "libdwP.h"
GElf_Shdr shdr_mem;
GElf_Shdr *shdr;
const char *scnname;
- int cnt;
+ size_t cnt;
/* Get the section header data. */
shdr = gelf_getshdr (scn, &shdr_mem);
{
/* The section name must be valid. Otherwise is the ELF file
invalid. */
- __libdwarf_seterrno (DWARF_E_INVALID_ELF);
+ __libdw_seterrno (DWARF_E_INVALID_ELF);
free (result);
return;
}
is correct. */
if (unlikely (result->sectiondata[IDX_debug_info] == NULL))
{
- __libdwarf_seterrno (DWARF_E_NO_DWARF);
+ __libdw_seterrno (DWARF_E_NO_DWARF);
result = NULL;
}
{
/* A section group refers to a non-existing section. Should
never happen. */
- __libdwarf_seterrno (DWARF_E_INVALID_ELF);
+ __libdw_seterrno (DWARF_E_INVALID_ELF);
free (result);
return NULL;
}
if (ehdr == NULL)
{
if (elf_kind (elf) != ELF_K_ELF)
- __libdwarf_seterrno (DWARF_E_NOELF);
+ __libdw_seterrno (DWARF_E_NOELF);
else
- __libdwarf_seterrno (DWARF_E_GETEHDR_ERROR);
+ __libdw_seterrno (DWARF_E_GETEHDR_ERROR);
return NULL;
}
+ /* Default memory allocation size. */
+ size_t mem_default_size = sysconf (_SC_PAGESIZE) - 4 * sizeof (void *);
+
/* Allocate the data structure. */
- result = (Dwarf *) calloc (1, sizeof (Dwarf));
+ result = (Dwarf *) calloc (1, sizeof (Dwarf) + mem_default_size);
if (result == NULL)
{
- __libdwarf_seterrno (DWARF_E_NOMEM);
+ __libdw_seterrno (DWARF_E_NOMEM);
return NULL;
}
result->elf = elf;
+ /* Initialize the memory handling. */
+ result->mem_default_size = mem_default_size;
+ result->oom_handler = __libdw_oom;
+ result->mem_tail = (struct libdw_memblock *) (result + 1);
+ result->mem_tail->size = (result->mem_default_size
+ - offsetof (struct libdw_memblock, mem));
+ result->mem_tail->remaining = result->mem_tail->size;
+ result->mem_tail->next = result->mem_tail->prev = NULL;
+
if (cmd == DWARF_C_READ || cmd == DWARF_C_RDWR)
{
}
else if (cmd == DWARF_C_WRITE)
{
- __libdwarf_seterrno (DWARF_E_UNIMPL);
+ __libdw_seterrno (DWARF_E_UNIMPL);
free (result);
return NULL;
}
- __libdwarf_seterrno (DWARF_E_INVALID_CMD);
+ __libdw_seterrno (DWARF_E_INVALID_CMD);
free (result);
return NULL;
}
/* Get public symbol information.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2003 Red Hat, Inc.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
This program is free software; you can redistribute it and/or modify
newmem = (struct pubnames_s *) realloc (mem, allocated * entsize);
if (newmem == NULL)
{
- __libdwarf_seterrno (DWARF_E_NOMEM);
+ __libdw_seterrno (DWARF_E_NOMEM);
err_return:
free (mem);
return -1;
version = read_2ubyte_unaligned (dbg, readp);
if (version != 2)
{
- __libdwarf_seterrno (DWARF_E_INVALID_VERSION);
+ __libdw_seterrno (DWARF_E_INVALID_VERSION);
goto err_return;
}
if (mem == NULL)
{
- __libdwarf_seterrno (DWARF_E_NO_ENTRY);
+ __libdw_seterrno (DWARF_E_NO_ENTRY);
return -1;
}
libdwarf.so: libdwarf_pic.a libdwarf.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
-Wl,--version-script,$(srcdir)/libdwarf.map,--no-undefined \
- -Wl,--soname,$@.$(VERSION) \
+ -Wl,--soname,$@.$(VERSION),-z,defs \
../libelf/libelf.so
ln -fs $@ $@.$(VERSION)
GElf_Shdr shdr_mem;
GElf_Shdr *shdr;
const char *scnname;
- int cnt;
+ size_t cnt;
Elf_Data *data;
/* Get the section header data. */
a direct offset in the section it is a offset from the
location of the FDE'S CIE ID value itself to the CIE entry. */
if (cie->cie->offset
- == (cie_id_ptr - cie_id
- - (Dwarf_Small *) dbg->sections[IDX_eh_frame].addr))
+ == (size_t) (cie_id_ptr - cie_id
+ - (Dwarf_Small *) dbg->sections[IDX_eh_frame].addr))
{
new_fde->fde->cie = cie->cie;
break;
do
{
if (cielist->cie->offset
- == (fdelist->cie_id_ptr - fdelist->fde->offset
- - (Dwarf_Small *) dbg->sections[IDX_eh_frame].addr))
+ == (size_t) (fdelist->cie_id_ptr - fdelist->fde->offset
+ - (Dwarf_Small *) dbg->sections[IDX_eh_frame].addr))
{
fdelist->fde->cie = cielist->cie;
break;
int length;
int res;
+ /* For now we haven't found anything. */
+ *srcfilecount = 0;
+
/* The die must be for a compilation unit. */
if (die->abbrev->tag != DW_TAG_compile_unit)
{
libebl.so: libebl_pic.a libebl.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
-Wl,--version-script,$(srcdir)/libebl.map,--no-undefined \
- -Wl,--soname,$@.$(VERSION) \
+ -Wl,--soname,$@.$(VERSION),-z,defs \
../libelf/libelf.so -ldl
ln -fs $@ $@.$(VERSION)
libebl_i386_so_SOURCES =
libebl_i386.so: libebl_i386_pic.a libebl_i386.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libebl_i386.map,--no-undefined
+ -Wl,--version-script,$(srcdir)/libebl_i386.map,--no-undefined \
+ -Wl,-z,defs
sh_SRCS = sh_init.c sh_destr.c sh_symbol.c
libebl_sh_so_SOURCES =
libebl_sh.so: libebl_sh_pic.a libebl_sh.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libebl_sh.map,--no-undefined
+ -Wl,--version-script,$(srcdir)/libebl_sh.map,--no-undefined \
+ -Wl,-z,defs
mips_SRCS = mips_init.c mips_destr.c mips_symbol.c
libebl_mips_so_SOURCES =
libebl_mips.so: libebl_mips_pic.a libebl_mips.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libebl_mips.map,--no-undefined
+ -Wl,--version-script,$(srcdir)/libebl_mips.map,--no-undefined \
+ -Wl,-z,defs
x86_64_SRCS = x86_64_init.c x86_64_destr.c x86_64_symbol.c
libebl_x86_64_so_SOURCES =
libebl_x86_64.so: libebl_x86_64_pic.a libebl_x86_64.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libebl_x86_64.map,--no-undefined
+ -Wl,--version-script,$(srcdir)/libebl_x86_64.map,--no-undefined \
+ -Wl,-z,defs
ia64_SRCS = ia64_init.c ia64_destr.c ia64_symbol.c
libebl_ia64_so_SOURCES =
libebl_ia64.so: libebl_ia64_pic.a libebl_ia64.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libebl_ia64.map,--no-undefined
+ -Wl,--version-script,$(srcdir)/libebl_ia64.map,--no-undefined \
+ -Wl,-z,defs
alpha_SRCS = alpha_init.c alpha_destr.c alpha_symbol.c
libebl_alpha_so_SOURCES =
libebl_alpha.so: libebl_alpha_pic.a libebl_alpha.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libebl_alpha.map,--no-undefined
+ -Wl,--version-script,$(srcdir)/libebl_alpha.map,--no-undefined \
+ -Wl,-z,defs
arm_SRCS = arm_init.c arm_destr.c arm_symbol.c
libebl_arm_so_SOURCES =
libebl_arm.so: libebl_arm_pic.a libebl_arm.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libebl_arm.map,--no-undefined
+ -Wl,--version-script,$(srcdir)/libebl_arm.map,--no-undefined \
+ -Wl,-z,defs
sparc_SRCS = sparc_init.c sparc_destr.c sparc_symbol.c
libebl_sparc_so_SOURCES =
libebl_sparc.so: libebl_sparc_pic.a libebl_sparc.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libebl_sparc.map,--no-undefined
+ -Wl,--version-script,$(srcdir)/libebl_sparc.map,--no-undefined \
+ -Wl,-z,defs
%.os: %.c %.o
GElf_Half machine;
{
Ebl *result;
- int cnt;
+ size_t cnt;
/* First allocate the data structure for the result. We do this
here since this assures that the structure is always large
};
/* Handle standard names. */
- if (section < sizeof (knowntypes) / sizeof (knowntypes[0])
+ if ((size_t) section < sizeof (knowntypes) / sizeof (knowntypes[0])
&& knowntypes[section] != NULL)
res = knowntypes[section];
/* The symbol versioning/Sun extensions. */
/* Handle processor-specific section names. */
else if (section >= SHT_LOPROC && section <= SHT_HIPROC)
snprintf (buf, len, "SHT_LOPROC+%x", section - SHT_LOPROC);
- else if (section >= SHT_LOUSER && section <= SHT_HIUSER)
+ else if ((unsigned int) section >= SHT_LOUSER
+ && (unsigned int) section <= SHT_HIUSER)
snprintf (buf, len, "SHT_LOUSER+%x", section - SHT_LOUSER);
else
snprintf (buf, len, "%s: %d", gettext ("<unknown>"), section);
libelf.so: libelf_pic.a libelf.map
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
-Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \
- -Wl,--soname,$@.$(VERSION)
+ -Wl,--soname,$@.$(VERSION),-z-defs
ln -fs $@ $@.$(VERSION)
%.os: %.c %.o
elf->state.ELFW(elf,LIBELFBITS).phdr_flags |= ELF_F_MALLOCED;
/* Read the header. */
- if (pread (elf->fildes, elf->state.ELFW(elf,LIBELFBITS).phdr, size,
- (elf->start_offset + ehdr->e_phoff)) != size)
+ if ((size_t) pread (elf->fildes,
+ elf->state.ELFW(elf,LIBELFBITS).phdr, size,
+ (elf->start_offset + ehdr->e_phoff)) != size)
{
/* Severe problems. We cannot read the data. */
__libelf_seterrno (ELF_E_READ_ERROR);
else if (elf->fildes != -1)
{
/* Read the header. */
- if (pread (elf->fildes, elf->state.ELFW(elf,LIBELFBITS).shdr, size,
- elf->start_offset + ehdr->e_shoff) != size)
+ if ((size_t) pread (elf->fildes,
+ elf->state.ELFW(elf,LIBELFBITS).shdr, size,
+ elf->start_offset + ehdr->e_shoff) != size)
{
/* Severe problems. We cannot read the data. */
__libelf_seterrno (ELF_E_READ_ERROR);
Elf_Scn **scnp = scns;
do
{
- int cnt;
+ size_t cnt;
for (cnt = 0; cnt < list->cnt; ++cnt)
*scnp++ = &list->data[cnt];
/* This many bytes we want to write in this round. */
size_t n = MIN (filled, len);
- if (unlikely (pwrite (fd, fillbuf, n, pos) != n))
+ if (unlikely ((size_t) pwrite (fd, fillbuf, n, pos) != n))
{
__libelf_seterrno (ELF_E_WRITE_ERROR);
return 1;
}
/* Write out the ELF header. */
- if (unlikely (pwrite (elf->fildes, out_phdr,
- sizeof (ElfW2(LIBELFBITS,Phdr)) * ehdr->e_phnum,
- ehdr->e_phoff)
+ if (unlikely ((size_t) pwrite (elf->fildes, out_phdr,
+ sizeof (ElfW2(LIBELFBITS,Phdr))
+ * ehdr->e_phnum, ehdr->e_phoff)
!= sizeof (ElfW2(LIBELFBITS,Phdr)) * ehdr->e_phnum))
{
__libelf_seterrno (ELF_E_WRITE_ERROR);
(*fctp) (buf, dl->data.d.d_buf, dl->data.d.d_size, 1);
}
- if (unlikely (pwrite (elf->fildes, buf,
- dl->data.d.d_size, last_offset)
+ if (unlikely ((size_t) pwrite (elf->fildes, buf,
+ dl->data.d.d_size,
+ last_offset)
!= dl->data.d.d_size))
{
if (buf != dl->data.d.d_buf && buf != tmpbuf)
/* Write out the section header table. */
if (shdr_flags & ELF_F_DIRTY
- && unlikely (pwrite (elf->fildes, shdr_data,
- sizeof (ElfW2(LIBELFBITS,Shdr)) * shnum,
- shdr_offset)
+ && unlikely ((size_t) pwrite (elf->fildes, shdr_data,
+ sizeof (ElfW2(LIBELFBITS,Shdr))
+ * shnum, shdr_offset)
!= sizeof (ElfW2(LIBELFBITS,Shdr)) * shnum))
{
__libelf_seterrno (ELF_E_WRITE_ERROR);
{
/* The user is supposed to fill out e_phoff. Use it and
e_phnum to determine the maximum extend. */
- size = MAX (size,
+ size = MAX ((size_t) size,
ehdr->e_phoff
+ elf_typesize (LIBELFBITS, ELF_T_PHDR, ehdr->e_phnum));
}
do
{
- int cnt;
+ size_t cnt;
for (cnt = first == true; cnt < list->cnt; ++cnt)
{
/* The user specified the offset and the size.
All we have to do is check whether this block
fits in the size specified for the section. */
- if (unlikely (dl->data.d.d_off + dl->data.d.d_size
+ if (unlikely ((GElf_Word) (dl->data.d.d_off
+ + dl->data.d.d_size)
> shdr->sh_size))
{
__libelf_seterrno (ELF_E_SECTION_TOO_SMALL);
if (elf->flags & ELF_F_LAYOUT)
{
- size = MAX (size,
+ size = MAX ((GElf_Word) size,
shdr->sh_offset
+ (shdr->sh_type != SHT_NOBITS
? shdr->sh_size : 0));
scn->shdr_flags);
size = (size + sh_align - 1) & ~(sh_align - 1);
- update_if_changed (shdr->sh_offset, size, changed);
+ update_if_changed (shdr->sh_offset, (GElf_Word) size,
+ changed);
/* See whether the section size is correct. */
- update_if_changed (shdr->sh_size, offset, changed);
+ update_if_changed (shdr->sh_size, (GElf_Word) offset,
+ changed);
if (shdr->sh_type != SHT_NOBITS)
size += offset;
{
/* The user is supposed to fill out e_phoff. Use it and
e_phnum to determine the maximum extend. */
- size = MAX (size, (ehdr->e_shoff
- + (elf_typesize (LIBELFBITS, ELF_T_SHDR,
- shnum))));
+ size = MAX ((GElf_Word) size,
+ (ehdr->e_shoff
+ + (elf_typesize (LIBELFBITS, ELF_T_SHDR, shnum))));
}
else
{
#define SHDR_ALIGN sizeof (ElfW2(LIBELFBITS,Off))
size = (size + SHDR_ALIGN - 1) & ~(SHDR_ALIGN - 1);
- update_if_changed (ehdr->e_shoff, size, elf->flags);
+ update_if_changed (ehdr->e_shoff, (GElf_Word) size, elf->flags);
update_if_changed (ehdr->e_shentsize,
elf_typesize (LIBELFBITS, ELF_T_SHDR, 1),
ehdr_flags);
ehdr.p = alloca (len);
/* Fill it. */
- if (pread (fildes, ehdr.p, len, offset) != len)
+ if ((size_t) pread (fildes, ehdr.p, len, offset) != len)
/* Failed reading. */
return (size_t) -1l;
len);
else
{
- if (pread (elf->fildes, newp, len,
- elf->start_offset + offset + sizeof (struct ar_hdr))
+ if ((size_t) pread (elf->fildes, newp, len,
+ elf->start_offset + offset
+ + sizeof (struct ar_hdr))
!= len)
{
/* We were not able to read all data. */
new_str = (char *) (elf->state.ar.ar_sym + n + 1);
/* Now read the data from the file. */
- if (pread (elf->fildes, file_data, n * sizeof (uint32_t),
- elf->start_offset
- + SARMAG + sizeof (struct ar_hdr)
- + sizeof (uint32_t)) != n * sizeof (uint32_t)
- || (pread (elf->fildes, new_str,
- index_size - n * sizeof (uint32_t),
- elf->start_offset
- + SARMAG + sizeof (struct ar_hdr)
- + (n + 1) * sizeof (uint32_t))
+ if ((size_t) pread (elf->fildes, file_data,
+ n * sizeof (uint32_t), elf->start_offset
+ + SARMAG + sizeof (struct ar_hdr)
+ + sizeof (uint32_t)) != n * sizeof (uint32_t)
+ || ((size_t) pread (elf->fildes, new_str,
+ index_size - n * sizeof (uint32_t),
+ elf->start_offset
+ + SARMAG + sizeof (struct ar_hdr)
+ + (n + 1) * sizeof (uint32_t))
!= index_size - n * sizeof (uint32_t)))
{
/* We were not able to read the data. */
return 1;
}
- if (pread (elf->fildes, scn->rawdata.d.d_buf, size,
- elf->start_offset + offset) != size)
+ if ((size_t) pread (elf->fildes, scn->rawdata.d.d_buf, size,
+ elf->start_offset + offset) != size)
{
/* Cannot read the data. */
free (scn->rawdata.d.d_buf);
if (mem != NULL)
{
/* Read the file content. */
- if (pread (elf->fildes, mem, elf->maximum_size,
- elf->start_offset) != elf->maximum_size)
+ if ((size_t) pread (elf->fildes, mem, elf->maximum_size,
+ elf->start_offset) != elf->maximum_size)
{
/* Something went wrong. */
__libelf_seterrno (ELF_E_READ_ERROR);
__libelf_seterrno (ELF_E_NOMEM);
else
/* Read the file content. */
- if (pread (elf->fildes, result, size, elf->start_offset + offset) != size)
+ if ((size_t) pread (elf->fildes, result, size, elf->start_offset + offset)
+ != size)
{
/* Something went wrong. */
__libelf_seterrno (ELF_E_READ_ERROR);
msgid " %#06x: Parent %d: %s\n"
msgstr ""
-#: src/readelf.c:2241
+#: src/readelf.c:2242
#, c-format
msgid ""
"\n"
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2273
+#: src/readelf.c:2274
msgid " 0 *local* "
msgstr ""
-#: src/readelf.c:2278
+#: src/readelf.c:2279
msgid " 1 *global* "
msgstr ""
-#: src/readelf.c:2334
+#: src/readelf.c:2335
#, c-format
msgid "cannot get data for section %d: %s"
msgstr ""
-#: src/readelf.c:2344
+#: src/readelf.c:2345
#, c-format
msgid ""
"\n"
msgstr[0] ""
msgstr[1] ""
-#: src/readelf.c:2389
+#: src/readelf.c:2390
#, c-format
msgid " Length Number % of total Coverage"
msgstr ""
-#: src/readelf.c:2390
+#: src/readelf.c:2391
#, c-format
msgid " 0 %6<PRIu32> %5.1f%%\n"
msgstr ""
-#: src/readelf.c:2396
+#: src/readelf.c:2397
#, c-format
msgid "%7d %6<PRIu32> %5.1f%% %5.1f%%\n"
msgstr ""
-#: src/readelf.c:2410
+#: src/readelf.c:2411
#, c-format
msgid ""
" Average number of tests: successful lookup: %f\n"
" unsuccessful lookup: %f\n"
msgstr ""
-#: src/readelf.c:2507
+#: src/readelf.c:2508
#, c-format
msgid "unknown tag %hx"
msgstr ""
-#: src/readelf.c:2509
+#: src/readelf.c:2510
#, c-format
msgid "unknown user tag %hx"
msgstr ""
-#: src/readelf.c:2692
+#: src/readelf.c:2693
#, c-format
msgid "unknown attribute %hx"
msgstr ""
-#: src/readelf.c:2695
+#: src/readelf.c:2696
#, c-format
msgid "unknown user attribute %hx"
msgstr ""
-#: src/readelf.c:2741
+#: src/readelf.c:2742
#, c-format
msgid "unknown form %<PRIx64>"
msgstr ""
msgid "while closing `%s'"
msgstr ""
-#: src/size.c:444 src/size.c:583
+#: src/size.c:442 src/size.c:584
#, c-format
msgid " (ex %s)"
msgstr ""
-#: src/size.c:608
+#: src/size.c:609
msgid "(TOTALS)\n"
msgstr ""
msgid "cannot change access mode of output file"
msgstr ""
-#: src/ldgeneric.c:5789
+#: src/ldgeneric.c:5785
+msgid "cannot stat output file"
+msgstr ""
+
+#: src/ldgeneric.c:5791
msgid "cannot rename output file"
msgstr ""
-#: src/ldgeneric.c:5837 src/ldgeneric.c:5848 src/ldgeneric.c:5859
-#: src/ldgeneric.c:5877 src/ldgeneric.c:5890 src/ldgeneric.c:5902
+#: src/ldgeneric.c:5801
+msgid "WARNING: temporary output overwritten before linking finished"
+msgstr ""
+
+#: src/ldgeneric.c:5854 src/ldgeneric.c:5865 src/ldgeneric.c:5876
+#: src/ldgeneric.c:5894 src/ldgeneric.c:5907 src/ldgeneric.c:5919
#, c-format
msgid "no machine specific '%s' implementation"
msgstr ""
#: src/elflint.c:706
#, c-format
-msgid "section [%2d] '%s': symbol %d: unknow symbol binding"
+msgid "section [%2d] '%s': symbol %d: unknown symbol binding"
msgstr ""
#: src/elflint.c:718
elf_errmsg (-1));
else
{
- int prev_error_message_count = error_message_count;
+ unsigned int prev_error_message_count = error_message_count;
struct stat64 st;
if (fstat64 (fd, &st) != 0)
/* Number of sections. */
-static int shnum;
+static unsigned int shnum;
static void
check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
{
char buf[512];
- int cnt;
+ size_t cnt;
/* Check e_ident field. */
if (ehdr->e_ident[EI_MAG0] != ELFMAG0)
{
/* No reference so far. Search following sections, maybe the
order is wrong. */
- int cnt;
+ size_t cnt;
for (cnt = idx + 1; cnt < shnum; ++cnt)
{
GElf_Shdr *shdr;
Elf_Data *data;
Elf32_Word *grpdata;
- int inner;
+ size_t inner;
scn = elf_getscn (ebl->elf, cnt);
shdr = gelf_getshdr (scn, &shdr_mem);
grpdata = (Elf32_Word *) data->d_buf;
for (inner = 1; inner < data->d_size / sizeof (Elf32_Word); ++inner)
- if (grpdata[inner] == idx)
+ if (grpdata[inner] == (Elf32_Word) idx)
goto out;
}
Elf_Data *data;
GElf_Shdr strshdr_mem;
GElf_Shdr *strshdr;
- int cnt;
+ size_t cnt;
GElf_Shdr xndxshdr_mem;
GElf_Shdr *xndxshdr = NULL;
Elf_Data *xndxdata = NULL;
/* Search for an extended section index table section. */
for (cnt = 1; cnt < shnum; ++cnt)
- if (cnt != idx)
+ if (cnt != (size_t) idx)
{
Elf_Scn *xndxscn = elf_getscn (ebl->elf, cnt);
xndxshdr = gelf_getshdr (xndxscn, &xndxshdr_mem);
continue;
if (xndxshdr->sh_type == SHT_SYMTAB_SHNDX
- && xndxshdr->sh_link == idx)
+ && xndxshdr->sh_link == (GElf_Word) idx)
break;
}
if (cnt == shnum)
if (GELF_ST_BIND (sym->st_info) >= STB_NUM)
error (0, 0, gettext ("\
-section [%2d] '%s': symbol %d: unknow symbol binding"),
+section [%2d] '%s': symbol %d: unknown symbol binding"),
idx, section_name (ebl, ehdr, idx), cnt);
if (xndx > 0 && xndx < shnum)
GElf_Shdr *symshdr;
GElf_Shdr destshdr_mem;
GElf_Shdr *destshdr = NULL;
- int cnt;
+ size_t cnt;
scn = elf_getscn (ebl->elf, idx);
shdr = gelf_getshdr (scn, &shdr_mem);
GElf_Shdr *symshdr;
GElf_Shdr destshdr_mem;
GElf_Shdr *destshdr = NULL;
- int cnt;
+ size_t cnt;
scn = elf_getscn (ebl->elf, idx);
shdr = gelf_getshdr (scn, &shdr_mem);
Elf_Data *data;
GElf_Shdr strshdr_mem;
GElf_Shdr *strshdr;
- int cnt;
+ size_t cnt;
static const bool dependencies[DT_NUM][DT_NUM] =
{
[DT_NEEDED] = { [DT_STRTAB] = true },
GElf_Shdr symshdr_mem;
GElf_Shdr *symshdr;
Elf_Scn *symscn;
- int cnt;
+ size_t cnt;
Elf_Data *data;
Elf_Data *symdata;
if (symshdr != NULL)
{
size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
- int cnt;
+ size_t cnt;
if (nchain < symshdr->sh_size / symshdr->sh_entsize)
error (0, 0,
{
const char *name;
size_t namelen;
- int type;
+ GElf_Word type;
enum { unused, exact, atleast } attrflag;
- int attr;
- int attr2;
+ GElf_Word attr;
+ GElf_Word attr2;
} special_sections[] =
{
/* See figure 4-14 in the gABI. */
{
GElf_Shdr shdr_mem;
GElf_Shdr *shdr;
- int cnt;
+ size_t cnt;
bool dot_interp_section = false;
/* Allocate array to count references in section groups. */
static bool reverse_sort;
/* Type of the section we are printing. */
-static int symsec_type = SHT_SYMTAB;
+static GElf_Word symsec_type = SHT_SYMTAB;
/* Sorting selection. */
static enum
&& (dwarf_attr (die, DW_AT_decl_file, &file, &err)
== DW_DLV_OK)
&& dwarf_formudata (file, &fileidx, &err) == DW_DLV_OK
- && fileidx > 0 && fileidx <= nfiles
+ && fileidx > 0 && fileidx <= (Dwarf_Unsigned) nfiles
&& (dwarf_attr (die, DW_AT_decl_line, &line, &err)
== DW_DLV_OK)
&& dwarf_formudata (line, &lineno, &err) == DW_DLV_OK
size_t nentries;
size_t cnt;
GElf_SymX *sym_mem;
- int longest_name = 4;
+ size_t longest_name = 4;
int sort_by_name (const void *p1, const void *p2)
{
/* Allocate the memory.
- XXX We can here a dirty trick. Since GElf_Sym == Elf64_Sym we
+ XXX We can use a dirty trick here. Since GElf_Sym == Elf64_Sym we
can use the data memory instead of copying again if what we read
is a 64 bit file. */
if (nentries * sizeof (GElf_SymX) < MAX_STACK_ALLOC)
int class = gelf_getclass (ebl->elf);
GElf_Shdr glink;
Elf_Data *data;
- int cnt;
+ size_t cnt;
size_t shstrndx;
/* Get the data of the section. */
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- if (shdr != NULL && shdr->sh_type == type)
+ if (shdr != NULL && shdr->sh_type == (GElf_Word) type)
handle_symtab (ebl, ehdr, scn, shdr);
}
}
if (def == NULL)
break;
- nvername = MAX (nvername, def->vd_ndx & 0x7fff);
+ nvername = MAX (nvername, (size_t) (def->vd_ndx & 0x7fff));
offset += def->vd_next;
}
if (aux == NULL)
break;
- nvername = MAX (nvername, aux->vna_other & 0x7fff);
+ nvername = MAX (nvername,
+ (size_t) (aux->vna_other & 0x7fff));
auxoffset += aux->vna_next;
}
Dwarf_Unsigned nextcu;
int ret;
Dwarf_Off cu_offset;
- int level;
+ size_t level;
printf (gettext ("\
\nDWARF section '%s' at offset %#" PRIx64 ":\n [Offset]\n"),
## Process this file with automake to create Makefile.in
## Configure input file for elfutils.
##
-## Copyright (C) 1996-2001, 2002 Red Hat, Inc.
+## Copyright (C) 1996-2002, 2003 Red Hat, Inc.
##
## This program is Open Source software; you can redistribute it and/or
## modify it under the terms of the Open Software License version 1.0 as
##
DEFS = -DHAVE_CONFIG_H -D_GNU_SOURCE
AM_CFLAGS = -Wall # -Werror
+AM_LDFLAGS = -Wl,-rpath,\$$ORIGIN/../libasm:\$$ORIGIN/../libdwarf:\$$ORIGIN/../libdw:\$$ORIGIN/../libebl:\$$ORIGIN/../libelf
INCLUDES = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdwarf \
-I$(top_srcdir)/libdw \
-I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
run-show-ciefde.sh run-show-abbrev.sh hash asm-tst1 asm-tst2 \
asm-tst3 asm-tst4 asm-tst5 asm-tst6 asm-tst7 asm-tst8 asm-tst9 \
msg_tst newscn run-strip-test.sh run-strip-test2.sh \
- run-get-pubnames2.sh run-ecp-test.sh run-ecp-test2.sh
+ run-ecp-test.sh run-ecp-test2.sh \
+ run-get-pubnames2.sh
EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-firstdie.sh \
run-show-dies.sh run-show-tags.sh run-show-die-info1.sh \
testfile6.bz2 testfile7.bz2 testfile8.bz2 testfile9.bz2 \
testfile10
-TESTS_ENVIRONMENT = LD_LIBRARY_PATH="../libelf:../libebl:../libasm:../libdwarf:../libdw$${LD_LIBRARY_PATH:+:}$$LD_LIBRARY_PATH"
-
arextract_LDADD = ../libelf/libelf.so
arsymtest_LDADD = ../libelf/libelf.so
newfile_LDADD = ../libelf/libelf.so
static int
callback (Dwarf *dbg, Dwarf_Global *gl, void *arg)
{
+ int result = DWARF_CB_OK;
+ const char *diename;
+ Dwarf_Die die;
+
printf (" [%2d] \"%s\", die: %llu, cu: %llu\n",
globcnt++, gl->name, (unsigned long long int) gl->die_offset,
(unsigned long long int) gl->cu_offset);
-#if 0
- {
Dwarf_Die cu_die;
const char *cuname;
const char *diename;
|| (cuname = dwarf_diename (&cu_die)) == NULL)
{
puts ("failed to get CU die");
- result = 1;
+ result = DWARF_CB_ABORT;
}
else
- {
- printf ("CU name: \"%s\"\n", cuname);
- dwarf_dealloc (dbg, cuname, DW_DLA_STRING);
- }
+ printf ("CU name: \"%s\"\n", cuname);
if (dwarf_offdie (dbg, gl->die_offset, &die) == NULL
|| (diename = dwarf_diename (&die)) == NULL)
{
puts ("failed to get object die");
- result = 1;
+ result = DWARF_CB_ABORT;
}
else
- {
- printf ("object name: \"%s\"\n", diename);
- dwarf_dealloc (dbg, diename, DW_DLA_STRING);
- }
- }
-#endif
- return DWARF_CB_OK;
+ printf ("object name: \"%s\"\n", diename);
+
+ return result;
}