* Makefile.am (BFD32_LIBS): Add compress.lo.
	(BFD32_LIBS_CFILES): Add compress.c.
	(BFD_H_FILES): Likewise.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* config.in: Add HAVE_ZLIB_H
	* configure.in: Add test for libz and zlib.h
	* configure: Regenerate.
	* dwarf2.c (read_section): New function.
	(read_indirect_string): Call new function read_section.
	(read_abbrevs): Likewise.
	(decode_line_info): Likewise.
	(read_debug_ranges): Likewise.
	(find_line): Call new function read_section when just one
	.zdebug_info section is found, otherwise read and compress
	multiple sections.
	(_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
	* elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
	(special_sections_z): New struct.
	(special_sections): Refer to special_sections_z.
	* elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
	sections named .zdebug_*.
	(_bfd_mips_elf_fake_sections): Likewise.
	* compress.c: New file.
	(bfd_uncompress_section_contents): New function.
bfd/doc/
	* Makefile.am (BFD_H_DEP): Add ../compress.c.
	* Makefile.in: Regenerate.
binutils/
	* config.in: Add HAVE_ZLIB_H
	* configure.in: Add test for libz and zlib.h
	* configure: Regenerate.
	* dwarf.c (debug_displays): Add .zdebug_* strings.
	* dwarf.h (struct dwarf_section): Add fields uncompressed_namd
	and compressed_name.
	* objdump.c (load_debug_section): Call
	bfd_uncompress_section_contents when loading a compressed
	section.
	(dump_dwarf_section): Recognize compressed section name.
	(mach_o_dwarf_sections): Rename as
	mach_o_uncompressed_dwarf_sections.
	(mach_o_compressed_dwarf_sections): New variable.
	(generic_dwarf_section): Rename as
	generic_uncompressed_dwarf_sections.
	(generic_compressed_dwarf_sections): New variable.
	(check_mach_o_dwarf): Save and restore
	mach_o_compressed_dwarf_sections.
	* readelf.c: Add #include for config.h and zlib.h
	(process_section_headers): Recognize compressed section name.
	(uncompress_section_contents): New function.
	(load_debug_section): Call uncompress_section_contents when
	loading a compressed section.
	(display_debug_section): Recognize compressed section name.
binutils/testsuite:
	* binutils-all/objdump.exp: Add test for objdump -s on a file
	with a compressed debug section.  Add test for objdump -W on a
	file that contains a compressed debug section.
	* binutils-all/readelf.exp: Call readelf_compressed_wa_test.
	(readelf_compressed_wa_test): New function.
	* binutils-all/dw2-compressed.S: New file.
	* binutils-all/objdump.W: New file.
	* binutils-all/objdump.s: New file.
	* binutils-all/readelf.wa: New file.
This commit is contained in:
Craig Silverstein 2008-07-10 01:32:23 +00:00
parent 67f9f80fe8
commit 1b31505692
31 changed files with 1968 additions and 799 deletions

View File

@ -1,3 +1,31 @@
2008-07-09 Craig Silverstein <csilvers@google.com>
* Makefile.am (BFD32_LIBS): Add compress.lo.
(BFD32_LIBS_CFILES): Add compress.c.
(BFD_H_FILES): Likewise.
* Makefile.in: Regenerate.
* bfd-in2.h: Regenerate.
* config.in: Add HAVE_ZLIB_H
* configure.in: Add test for libz and zlib.h
* configure: Regenerate.
* dwarf2.c (read_section): New function.
(read_indirect_string): Call new function read_section.
(read_abbrevs): Likewise.
(decode_line_info): Likewise.
(read_debug_ranges): Likewise.
(find_line): Call new function read_section when just one
.zdebug_info section is found, otherwise read and compress
multiple sections.
(_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
* elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
(special_sections_z): New struct.
(special_sections): Refer to special_sections_z.
* elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
sections named .zdebug_*.
(_bfd_mips_elf_fake_sections): Likewise.
* compress.c: New file.
(bfd_uncompress_section_contents): New function.
2008-07-07 Christophe Lyon <christophe.lyon@st.com>
* elf32-arm.c (arm_type_of_stub): Don't crash on local symbols in

View File

@ -42,7 +42,7 @@ BFD32_LIBS = \
format.lo init.lo libbfd.lo opncls.lo reloc.lo \
section.lo syms.lo targets.lo hash.lo linker.lo \
srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
merge.lo dwarf2.lo simple.lo
merge.lo dwarf2.lo simple.lo compress.lo
BFD64_LIBS = archive64.lo
@ -52,7 +52,7 @@ BFD32_LIBS_CFILES = \
format.c init.c libbfd.c opncls.c reloc.c \
section.c syms.c targets.c hash.c linker.c \
srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
merge.c dwarf2.c simple.c
merge.c dwarf2.c simple.c compress.c
BFD64_LIBS_CFILES = archive64.c
@ -938,7 +938,7 @@ stmp-bfd-h: bfd-in3.h
BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
reloc.c syms.c bfd.c bfdio.c bfdwin.c \
archive.c corefile.c targets.c format.c
archive.c corefile.c targets.c format.c compress.c
BFD64_H_FILES = archive64.c
LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c bfdio.c bfdwin.c \
cache.c reloc.c archures.c elf.c
@ -1064,6 +1064,7 @@ dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/elf/dwarf2.h
simple.lo: simple.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h
compress.lo: compress.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/aout/ar.h
cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h

View File

@ -87,7 +87,7 @@ am__objects_1 = archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo \
opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo \
linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo \
stab-syms.lo merge.lo dwarf2.lo simple.lo
stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo
am_libbfd_la_OBJECTS = $(am__objects_1)
libbfd_la_OBJECTS = $(am_libbfd_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
@ -295,7 +295,7 @@ BFD32_LIBS = \
format.lo init.lo libbfd.lo opncls.lo reloc.lo \
section.lo syms.lo targets.lo hash.lo linker.lo \
srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
merge.lo dwarf2.lo simple.lo
merge.lo dwarf2.lo simple.lo compress.lo
BFD64_LIBS = archive64.lo
BFD32_LIBS_CFILES = \
@ -304,7 +304,7 @@ BFD32_LIBS_CFILES = \
format.c init.c libbfd.c opncls.c reloc.c \
section.c syms.c targets.c hash.c linker.c \
srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
merge.c dwarf2.c simple.c
merge.c dwarf2.c simple.c compress.c
BFD64_LIBS_CFILES = archive64.c
@ -971,7 +971,7 @@ BFD_H_DEPS = $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
LOCAL_H_DEPS = libbfd.h sysdep.h config.h
BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
reloc.c syms.c bfd.c bfdio.c bfdwin.c \
archive.c corefile.c targets.c format.c
archive.c corefile.c targets.c format.c compress.c
BFD64_H_FILES = archive64.c
LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c bfdio.c bfdwin.c \
@ -994,15 +994,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
cd $(srcdir) && $(AUTOMAKE) --cygnus \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --cygnus Makefile
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@ -1647,6 +1647,7 @@ dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/elf/dwarf2.h
simple.lo: simple.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h
compress.lo: compress.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h
archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/aout/ar.h
cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h

View File

@ -2,7 +2,7 @@
generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
"bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
"syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
"linker.c" and "simple.c".
"linker.c", "simple.c" and "compress.c".
Run "make headers" in your build bfd/ to regenerate. */
/* Main header file for the bfd library -- portable access to object files.
@ -5468,6 +5468,10 @@ void bfd_section_already_linked (bfd *abfd, asection *sec,
bfd_byte *bfd_simple_get_relocated_section_contents
(bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
/* Extracted from compress.c. */
bfd_boolean bfd_uncompress_section_contents
(bfd_byte **buffer, bfd_size_type *size);
#ifdef __cplusplus
}
#endif

122
bfd/compress.c Normal file
View File

@ -0,0 +1,122 @@
/* ELF attributes support (based on ARM EABI attributes).
Copyright 2008
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "config.h"
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
/*
FUNCTION
bfd_uncompress_section_contents
SYNOPSIS
bfd_boolean bfd_uncompress_section_contents
(bfd_byte **buffer, bfd_size_type *size);
DESCRIPTION
Uncompresses a section that was compressed using zlib, in place. At
the call to this function, *@var{buffer} and *@var{size} should point
to the section contents to be uncompressed. At the end of the
function, *@var{buffer} and *@var{size} will point to the uncompressed
contents. This function assumes *BUFFER was allocated using
bfd_malloc() or equivalent. If the section is not a valid compressed
section, or zlib is not installed on this machine, the input is
unmodified.
Returns @code{FALSE} if unable to uncompress successfully; in that case
the input is unmodified. Otherwise, returns @code{TRUE}.
*/
bfd_boolean
bfd_uncompress_section_contents (bfd_byte **buffer, bfd_size_type *size)
{
#ifndef HAVE_ZLIB_H
/* These are just to quiet gcc. */
buffer = 0;
size = 0;
return FALSE;
#else
bfd_size_type compressed_size = *size;
bfd_byte *compressed_buffer = *buffer;
bfd_size_type uncompressed_size;
bfd_byte *uncompressed_buffer;
z_stream strm;
int rc;
bfd_size_type header_size = 12;
/* Read the zlib header. In this case, it should be "ZLIB" followed
by the uncompressed section size, 8 bytes in big-endian order. */
if (compressed_size < header_size
|| ! CONST_STRNEQ ((char*) compressed_buffer, "ZLIB"))
return FALSE;
uncompressed_size = compressed_buffer[4]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[5]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[6]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[7]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[8]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[9]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[10]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[11];
/* It is possible the section consists of several compressed
buffers concatenated together, so we uncompress in a loop. */
strm.zalloc = NULL;
strm.zfree = NULL;
strm.opaque = NULL;
strm.avail_in = compressed_size - header_size;
strm.next_in = (Bytef*) compressed_buffer + header_size;
strm.avail_out = uncompressed_size;
uncompressed_buffer = bfd_malloc (uncompressed_size);
if (! uncompressed_buffer)
return FALSE;
rc = inflateInit (&strm);
while (strm.avail_in > 0)
{
if (rc != Z_OK)
goto fail;
strm.next_out = ((Bytef*) uncompressed_buffer
+ (uncompressed_size - strm.avail_out));
rc = inflate (&strm, Z_FINISH);
if (rc != Z_STREAM_END)
goto fail;
rc = inflateReset (&strm);
}
rc = inflateEnd (&strm);
if (rc != Z_OK
|| strm.avail_out != 0)
goto fail;
free (compressed_buffer);
*buffer = uncompressed_buffer;
*size = uncompressed_size;
return TRUE;
fail:
free (uncompressed_buffer);
return FALSE;
#endif /* HAVE_ZLIB_H */
}

View File

@ -224,6 +224,9 @@
/* Define if <sys/procfs.h> has win32_pstatus_t. */
#undef HAVE_WIN32_PSTATUS_T
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR

959
bfd/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -198,6 +198,10 @@ AC_CHECK_DECLS(strstr)
AC_CHECK_DECLS(snprintf)
AC_CHECK_DECLS(vsnprintf)
# Link in zlib if we can. This allows us to read compressed debug sections.
# This is used only by compress.c.
AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
# If we are configured native, pick a core file support file.
COREFILE=
COREFLAG=

View File

@ -1,3 +1,8 @@
2008-07-09 Craig Silverstein <csilvers@google.com>
* Makefile.am (BFD_H_DEP): Add ../compress.c.
* Makefile.in: Regenerate.
2008-05-14 Alan Modra <amodra@bigpond.net.au>
* Makefile.in: Regenerate.

View File

@ -253,6 +253,7 @@ BFD_H_DEP = \
$(srcdir)/../format.c \
$(srcdir)/../linker.c \
$(srcdir)/../simple.c \
$(srcdir)/../compress.c \
$(srcdir)/header.sed \
$(srcdir)/proto.str \
$(srcdir)/../version.h \

View File

@ -333,6 +333,7 @@ BFD_H_DEP = \
$(srcdir)/../format.c \
$(srcdir)/../linker.c \
$(srcdir)/../simple.c \
$(srcdir)/../compress.c \
$(srcdir)/header.sed \
$(srcdir)/proto.str \
$(srcdir)/../version.h \
@ -358,9 +359,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --cygnus doc/Makefile
$(AUTOMAKE) --foreign doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \

View File

@ -389,6 +389,79 @@ lookup_info_hash_table (struct info_hash_table *hash_table, const char *key)
return entry ? entry->head : NULL;
}
/* Read a section into its appropriate place in the dwarf2_debug
struct (indicated by SECTION_BUFFER and SECTION_SIZE). If syms is
not NULL, use bfd_simple_get_relocated_section_contents to read the
section contents, otherwise use bfd_get_section_contents. */
static bfd_boolean
read_section (bfd *abfd,
const char* section_name, const char* compressed_section_name,
asymbol** syms, bfd_uint64_t offset,
bfd_byte **section_buffer, unsigned long *section_size)
{
asection *msec;
bfd_boolean section_is_compressed = FALSE;
/* read_section is a noop if the section has already been read. */
if (*section_buffer)
return TRUE;
msec = bfd_get_section_by_name (abfd, section_name);
if (! msec && compressed_section_name)
{
msec = bfd_get_section_by_name (abfd, compressed_section_name);
section_is_compressed = TRUE;
}
if (! msec)
{
(*_bfd_error_handler) (_("Dwarf Error: Can't find %s section."), section_name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (syms)
{
*section_size = msec->size;
*section_buffer
= bfd_simple_get_relocated_section_contents (abfd, msec, NULL, syms);
if (! *section_buffer)
return FALSE;
}
else
{
*section_size = msec->rawsize ? msec->rawsize : msec->size;
*section_buffer = bfd_malloc (*section_size);
if (! *section_buffer)
return FALSE;
if (! bfd_get_section_contents (abfd, msec, *section_buffer,
0, *section_size))
return FALSE;
}
if (section_is_compressed)
{
if (! bfd_uncompress_section_contents (section_buffer, section_size))
{
(*_bfd_error_handler) (_("Dwarf Error: unable to decompress %s section."), compressed_section_name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
}
/* It is possible to get a bad value for the offset into the section
* that the client wants. Validate it here to avoid trouble later. */
if (offset != 0 && offset >= *section_size)
{
(*_bfd_error_handler) (_("Dwarf Error: Offset (%lu) greater than or equal to %s size (%lu)."),
offset, section_name, *section_size);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
return TRUE;
}
/* VERBATIM
The following function up to the END VERBATIM mark are
copied directly from dwarf2read.c. */
@ -468,39 +541,10 @@ read_indirect_string (struct comp_unit* unit,
offset = read_8_bytes (unit->abfd, buf);
*bytes_read_ptr = unit->offset_size;
if (! stash->dwarf_str_buffer)
{
asection *msec;
bfd *abfd = unit->abfd;
bfd_size_type sz;
msec = bfd_get_section_by_name (abfd, ".debug_str");
if (! msec)
{
(*_bfd_error_handler)
(_("Dwarf Error: Can't find .debug_str section."));
bfd_set_error (bfd_error_bad_value);
return NULL;
}
sz = msec->rawsize ? msec->rawsize : msec->size;
stash->dwarf_str_size = sz;
stash->dwarf_str_buffer = bfd_alloc (abfd, sz);
if (! stash->dwarf_str_buffer)
return NULL;
if (! bfd_get_section_contents (abfd, msec, stash->dwarf_str_buffer,
0, sz))
return NULL;
}
if (offset >= stash->dwarf_str_size)
{
(*_bfd_error_handler) (_("Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str size (%lu)."),
(unsigned long) offset, stash->dwarf_str_size);
bfd_set_error (bfd_error_bad_value);
return NULL;
}
if (! read_section (unit->abfd, ".debug_str", ".zdebug_str",
0, offset,
&stash->dwarf_str_buffer, &stash->dwarf_str_size))
return 0;
str = (char *) stash->dwarf_str_buffer + offset;
if (*str == '\0')
@ -582,33 +626,10 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash)
unsigned int abbrev_form, hash_number;
bfd_size_type amt;
if (! stash->dwarf_abbrev_buffer)
{
asection *msec;
msec = bfd_get_section_by_name (abfd, ".debug_abbrev");
if (! msec)
{
(*_bfd_error_handler) (_("Dwarf Error: Can't find .debug_abbrev section."));
bfd_set_error (bfd_error_bad_value);
return 0;
}
stash->dwarf_abbrev_size = msec->size;
stash->dwarf_abbrev_buffer
= bfd_simple_get_relocated_section_contents (abfd, msec, NULL,
stash->syms);
if (! stash->dwarf_abbrev_buffer)
return 0;
}
if (offset >= stash->dwarf_abbrev_size)
{
(*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)."),
(unsigned long) offset, stash->dwarf_abbrev_size);
bfd_set_error (bfd_error_bad_value);
return 0;
}
if (! read_section (abfd, ".debug_abbrev", ".zdebug_abbrev",
stash->syms, offset,
&stash->dwarf_abbrev_buffer, &stash->dwarf_abbrev_size))
return 0;
amt = sizeof (struct abbrev_info*) * ABBREV_HASH_SIZE;
abbrevs = bfd_zalloc (abfd, amt);
@ -1138,35 +1159,10 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
unsigned char op_code, extended_op, adj_opcode;
bfd_size_type amt;
if (! stash->dwarf_line_buffer)
{
asection *msec;
msec = bfd_get_section_by_name (abfd, ".debug_line");
if (! msec)
{
(*_bfd_error_handler) (_("Dwarf Error: Can't find .debug_line section."));
bfd_set_error (bfd_error_bad_value);
return 0;
}
stash->dwarf_line_size = msec->size;
stash->dwarf_line_buffer
= bfd_simple_get_relocated_section_contents (abfd, msec, NULL,
stash->syms);
if (! stash->dwarf_line_buffer)
return 0;
}
/* It is possible to get a bad value for the line_offset. Validate
it here so that we won't get a segfault below. */
if (unit->line_offset >= stash->dwarf_line_size)
{
(*_bfd_error_handler) (_("Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%lu)."),
unit->line_offset, stash->dwarf_line_size);
bfd_set_error (bfd_error_bad_value);
return 0;
}
if (! read_section (abfd, ".debug_line", ".zdebug_line",
stash->syms, unit->line_offset,
&stash->dwarf_line_buffer, &stash->dwarf_line_size))
return 0;
amt = sizeof (struct line_info_table);
table = bfd_alloc (abfd, amt);
@ -1568,27 +1564,9 @@ static bfd_boolean
read_debug_ranges (struct comp_unit *unit)
{
struct dwarf2_debug *stash = unit->stash;
if (! stash->dwarf_ranges_buffer)
{
bfd *abfd = unit->abfd;
asection *msec;
msec = bfd_get_section_by_name (abfd, ".debug_ranges");
if (! msec)
{
(*_bfd_error_handler) (_("Dwarf Error: Can't find .debug_ranges section."));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
stash->dwarf_ranges_size = msec->size;
stash->dwarf_ranges_buffer
= bfd_simple_get_relocated_section_contents (abfd, msec, NULL,
stash->syms);
if (! stash->dwarf_ranges_buffer)
return FALSE;
}
return TRUE;
return read_section (unit->abfd, ".debug_ranges", ".zdebug_ranges",
stash->syms, 0,
&stash->dwarf_ranges_buffer, &stash->dwarf_ranges_size);
}
/* Function table functions. */
@ -2461,6 +2439,7 @@ comp_unit_hash_info (struct dwarf2_debug *stash,
identify and discard duplicate debugging sections for different
compilation units. */
#define DWARF2_DEBUG_INFO ".debug_info"
#define DWARF2_COMPRESSED_DEBUG_INFO ".zdebug_info"
#define GNU_LINKONCE_INFO ".gnu.linkonce.wi."
static asection *
@ -2475,6 +2454,9 @@ find_debug_info (bfd *abfd, asection *after_sec)
if (strcmp (msec->name, DWARF2_DEBUG_INFO) == 0)
return msec;
if (strcmp (msec->name, DWARF2_COMPRESSED_DEBUG_INFO) == 0)
return msec;
if (CONST_STRNEQ (msec->name, GNU_LINKONCE_INFO))
return msec;
@ -2916,41 +2898,97 @@ find_line (bfd *abfd,
else
debug_bfd = abfd;
/* There can be more than one DWARF2 info section in a BFD these days.
Read them all in and produce one large stash. We do this in two
passes - in the first pass we just accumulate the section sizes.
In the second pass we read in the section's contents. The allows
us to avoid reallocing the data as we add sections to the stash. */
for (total_size = 0; msec; msec = find_debug_info (debug_bfd, msec))
total_size += msec->size;
/* There can be more than one DWARF2 info section in a BFD these
days. First handle the easy case when there's only one. If
there's more than one, try case two: none of the sections is
compressed. In that case, read them all in and produce one
large stash. We do this in two passes - in the first pass we
just accumulate the section sizes, and in the second pass we
read in the section's contents. (The allows us to avoid
reallocing the data as we add sections to the stash.) If
some or all sections are compressed, then do things the slow
way, with a bunch of reallocs. */
stash->info_ptr = bfd_alloc (debug_bfd, total_size);
if (stash->info_ptr == NULL)
goto done;
if (! find_debug_info (debug_bfd, msec))
{
/* Case 1: only one info section. */
total_size = msec->size;
if (! read_section (debug_bfd, ".debug_info", ".zdebug_info",
symbols, 0,
&stash->info_ptr, &total_size))
goto done;
stash->info_ptr_end = stash->info_ptr + total_size;
}
else
{
int all_uncompressed = 1;
for (total_size = 0; msec; msec = find_debug_info (debug_bfd, msec))
{
total_size += msec->size;
if (strcmp (msec->name, DWARF2_COMPRESSED_DEBUG_INFO) == 0)
all_uncompressed = 0;
}
if (all_uncompressed)
{
/* Case 2: multiple sections, but none is compressed. */
stash->info_ptr = bfd_malloc (total_size);
if (stash->info_ptr == NULL)
goto done;
stash->info_ptr_end = stash->info_ptr;
stash->info_ptr_end = stash->info_ptr;
for (msec = find_debug_info (debug_bfd, NULL);
msec;
msec = find_debug_info (debug_bfd, msec))
{
bfd_size_type size;
bfd_size_type start;
for (msec = find_debug_info (debug_bfd, NULL);
msec;
msec = find_debug_info (debug_bfd, msec))
{
bfd_size_type size;
bfd_size_type start;
size = msec->size;
if (size == 0)
continue;
size = msec->size;
if (size == 0)
continue;
start = stash->info_ptr_end - stash->info_ptr;
start = stash->info_ptr_end - stash->info_ptr;
if ((bfd_simple_get_relocated_section_contents
(debug_bfd, msec, stash->info_ptr + start, symbols)) == NULL)
continue;
if ((bfd_simple_get_relocated_section_contents
(debug_bfd, msec, stash->info_ptr + start, symbols))
== NULL)
continue;
stash->info_ptr_end = stash->info_ptr + start + size;
}
stash->info_ptr_end = stash->info_ptr + start + size;
}
BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size);
BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size);
}
else
{
/* Case 3: multiple sections, some or all compressed. */
stash->info_ptr = bfd_malloc (1);
stash->info_ptr_end = stash->info_ptr;
for (msec = find_debug_info (debug_bfd, NULL);
msec;
msec = find_debug_info (debug_bfd, msec))
{
bfd_size_type size = msec->size;
bfd_byte* buffer
= (bfd_simple_get_relocated_section_contents
(debug_bfd, msec, NULL, symbols));
if (! buffer)
continue;
if (strcmp (msec->name, DWARF2_COMPRESSED_DEBUG_INFO) == 0)
{
if (! bfd_uncompress_section_contents (&buffer, &size))
continue;
}
stash->info_ptr = bfd_realloc (stash->info_ptr,
stash->info_ptr_end
- stash->info_ptr + size);
memcpy (stash->info_ptr_end, buffer, size);
free (buffer);
stash->info_ptr_end += size;
}
}
}
stash->sec = find_debug_info (debug_bfd, NULL);
stash->sec_info_ptr = stash->info_ptr;
@ -3254,4 +3292,5 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd)
free (stash->dwarf_abbrev_buffer);
free (stash->dwarf_line_buffer);
free (stash->dwarf_ranges_buffer);
free (stash->sec_info_ptr);
}

View File

@ -890,7 +890,14 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
{ NULL, 0 }, /* 'p' */
{ NULL, 0 }, /* 'q' */
{ NULL, 0 }, /* 'r' */
{ STRING_COMMA_LEN ("stab") } /* 's' */
{ STRING_COMMA_LEN ("stab") }, /* 's' */
{ NULL, 0 }, /* 't' */
{ NULL, 0 }, /* 'u' */
{ NULL, 0 }, /* 'v' */
{ NULL, 0 }, /* 'w' */
{ NULL, 0 }, /* 'x' */
{ NULL, 0 }, /* 'y' */
{ STRING_COMMA_LEN ("zdebug") } /* 'z' */
};
if (name [0] == '.')
@ -2119,6 +2126,15 @@ static const struct bfd_elf_special_section special_sections_t[] =
{ NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_z[] =
{
{ STRING_COMMA_LEN (".zdebug_line"), 0, SHT_PROGBITS, 0 },
{ STRING_COMMA_LEN (".zdebug_info"), 0, SHT_PROGBITS, 0 },
{ STRING_COMMA_LEN (".zdebug_abbrev"), 0, SHT_PROGBITS, 0 },
{ STRING_COMMA_LEN (".zdebug_aranges"), 0, SHT_PROGBITS, 0 },
{ NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section *special_sections[] =
{
special_sections_b, /* 'b' */
@ -2140,6 +2156,12 @@ static const struct bfd_elf_special_section *special_sections[] =
special_sections_r, /* 'r' */
special_sections_s, /* 's' */
special_sections_t, /* 't' */
NULL, /* 'u' */
NULL, /* 'v' */
NULL, /* 'w' */
NULL, /* 'x' */
NULL, /* 'y' */
special_sections_z /* 'z' */
};
const struct bfd_elf_special_section *
@ -2216,7 +2238,7 @@ _bfd_elf_get_sec_type_attr (bfd *abfd, asection *sec)
return NULL;
i = sec->name[1] - 'b';
if (i < 0 || i > 't' - 'b')
if (i < 0 || i > 'z' - 'b')
return NULL;
spec = special_sections[i];

View File

@ -5701,7 +5701,8 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd,
return FALSE;
break;
case SHT_MIPS_DWARF:
if (! CONST_STRNEQ (name, ".debug_"))
if (! CONST_STRNEQ (name, ".debug_")
&& ! CONST_STRNEQ (name, ".zdebug_")
return FALSE;
break;
case SHT_MIPS_SYMBOL_LIB:
@ -5895,7 +5896,8 @@ _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
hdr->sh_entsize = 1;
hdr->sh_flags |= SHF_MIPS_NOSTRIP;
}
else if (CONST_STRNEQ (name, ".debug_"))
else if (CONST_STRNEQ (name, ".debug_")
|| CONST_STRNEQ (name, ".zdebug_"))
{
hdr->sh_type = SHT_MIPS_DWARF;

View File

@ -1,3 +1,30 @@
2008-07-09 Craig Silverstein <csilvers@google.com>
* config.in: Add HAVE_ZLIB_H
* configure.in: Add test for libz and zlib.h
* configure: Regenerate.
* dwarf.c (debug_displays): Add .zdebug_* strings.
* dwarf.h (struct dwarf_section): Add fields uncompressed_namd
and compressed_name.
* objdump.c (load_debug_section): Call
bfd_uncompress_section_contents when loading a compressed
section.
(dump_dwarf_section): Recognize compressed section name.
(mach_o_dwarf_sections): Rename as
mach_o_uncompressed_dwarf_sections.
(mach_o_compressed_dwarf_sections): New variable.
(generic_dwarf_section): Rename as
generic_uncompressed_dwarf_sections.
(generic_compressed_dwarf_sections): New variable.
(check_mach_o_dwarf): Save and restore
mach_o_compressed_dwarf_sections.
* readelf.c: Add #include for config.h and zlib.h
(process_section_headers): Recognize compressed section name.
(uncompress_section_contents): New function.
(load_debug_section): Call uncompress_section_contents when
loading a compressed section.
(display_debug_section): Recognize compressed section name.
2008-07-07 Alan Modra <amodra@bigpond.net.au>
* objdump.c (find_symbol_for_address): Prefer symbols in current

View File

@ -534,15 +534,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
cd $(srcdir) && $(AUTOMAKE) --cygnus \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --cygnus Makefile
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \

View File

@ -148,6 +148,9 @@
/* Define to 1 if you have the `utimes' function. */
#undef HAVE_UTIMES
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST

506
binutils/configure vendored
View File

@ -1128,7 +1128,7 @@ esac
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi
cd $ac_popdir
cd "$ac_popdir"
done
fi
@ -2175,8 +2175,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -2234,8 +2233,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -2351,8 +2349,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -2406,8 +2403,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -2452,8 +2448,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -2497,8 +2492,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -2576,8 +2570,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -2631,8 +2624,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -3634,8 +3626,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -3693,8 +3684,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -3810,8 +3800,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -3865,8 +3854,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -3911,8 +3899,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -3956,8 +3943,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -4535,13 +4521,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:4538: $ac_compile\"" >&5)
(eval echo "\"\$as_me:4524: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:4541: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval echo "\"\$as_me:4527: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:4544: output\"" >&5)
(eval echo "\"\$as_me:4530: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@ -5596,7 +5582,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 5599 "configure"' > conftest.$ac_ext
echo '#line 5585 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -5723,8 +5709,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -6052,8 +6037,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -6223,8 +6207,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -6285,8 +6268,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -6698,11 +6680,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6701: $lt_compile\"" >&5)
(eval echo "\"\$as_me:6683: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:6705: \$? = $ac_status" >&5
echo "$as_me:6687: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -7020,11 +7002,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7023: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7005: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7027: \$? = $ac_status" >&5
echo "$as_me:7009: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -7125,11 +7107,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7128: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7110: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7132: \$? = $ac_status" >&5
echo "$as_me:7114: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -7180,11 +7162,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7183: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7165: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7187: \$? = $ac_status" >&5
echo "$as_me:7169: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -7683,8 +7665,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -7752,8 +7733,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -8046,8 +8026,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -8999,8 +8978,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -9437,8 +9415,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -9541,8 +9518,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -9607,8 +9583,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -9701,8 +9676,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -9767,8 +9741,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -9834,8 +9807,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -9901,8 +9873,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -9977,7 +9948,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 9980 "configure"
#line 9951 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -10077,7 +10048,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10080 "configure"
#line 10051 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -10531,8 +10502,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -10598,8 +10568,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -10688,8 +10657,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -11424,8 +11392,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -11579,8 +11546,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -11642,8 +11608,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -11724,8 +11689,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -11866,8 +11830,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12043,8 +12006,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12141,8 +12103,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12239,8 +12200,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12304,8 +12264,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12348,8 +12307,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12414,8 +12372,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12458,8 +12415,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12544,8 +12500,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12599,8 +12554,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12662,8 +12616,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12724,8 +12677,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12786,8 +12738,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12854,8 +12805,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12919,8 +12869,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -12989,8 +12938,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -13059,8 +13007,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -13129,8 +13076,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -13199,8 +13145,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -13269,8 +13214,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -13339,8 +13283,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -13409,8 +13352,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -13479,8 +13421,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -13520,6 +13461,282 @@ fi
# Link in zlib if we can. This allows us to read compressed debug
# sections. This is used only by readelf.c (objdump uses bfd for
# reading compressed sections).
echo "$as_me:$LINENO: checking for library containing zlibVersion" >&5
echo $ECHO_N "checking for library containing zlibVersion... $ECHO_C" >&6
if test "${ac_cv_search_zlibVersion+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_zlibVersion=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char zlibVersion ();
int
main ()
{
zlibVersion ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_zlibVersion="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_zlibVersion" = no; then
for ac_lib in z; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char zlibVersion ();
int
main ()
{
zlibVersion ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_zlibVersion="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_search_zlibVersion" >&5
echo "${ECHO_T}$ac_cv_search_zlibVersion" >&6
if test "$ac_cv_search_zlibVersion" != no; then
test "$ac_cv_search_zlibVersion" = "none required" || LIBS="$ac_cv_search_zlibVersion $LIBS"
for ac_header in zlib.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists. ##
## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
fi
case "${host}" in
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
@ -13576,8 +13793,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -14293,8 +14509,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -14344,8 +14559,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -14435,8 +14649,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@ -15902,11 +16115,6 @@ esac
*) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
if test x"$ac_file" != x-; then
{ echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
@ -15945,6 +16153,12 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
fi;;
esac
done` || { (exit 1); exit 1; }
if test x"$ac_file" != x-; then
{ echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub

View File

@ -182,6 +182,11 @@ fi
AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
snprintf, vsnprintf])
# Link in zlib if we can. This allows us to read compressed debug
# sections. This is used only by readelf.c (objdump uses bfd for
# reading compressed sections).
AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
BFD_BINARY_FOPEN
# target-specific stuff:

View File

@ -285,9 +285,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --cygnus doc/Makefile
$(AUTOMAKE) --foreign doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \

View File

@ -4613,36 +4613,36 @@ free_debug_memory (void)
struct dwarf_section_display debug_displays[] =
{
{ { ".debug_abbrev", NULL, 0, 0 },
{ { ".debug_abbrev", ".zdebug_abbrev", NULL, NULL, 0, 0 },
display_debug_abbrev, 0, 0 },
{ { ".debug_aranges", NULL, 0, 0 },
{ { ".debug_aranges", ".zdebug_aranges", NULL, NULL, 0, 0 },
display_debug_aranges, 0, 0 },
{ { ".debug_frame", NULL, 0, 0 },
{ { ".debug_frame", ".zdebug_frame", NULL, NULL, 0, 0 },
display_debug_frames, 1, 0 },
{ { ".debug_info", NULL, 0, 0 },
{ { ".debug_info", ".zdebug_info", NULL, NULL, 0, 0 },
display_debug_info, 1, 0 },
{ { ".debug_line", NULL, 0, 0 },
{ { ".debug_line", ".zdebug_line", NULL, NULL, 0, 0 },
display_debug_lines, 0, 0 },
{ { ".debug_pubnames", NULL, 0, 0 },
{ { ".debug_pubnames", ".zdebug_pubnames", NULL, NULL, 0, 0 },
display_debug_pubnames, 0, 0 },
{ { ".eh_frame", NULL, 0, 0 },
{ { ".eh_frame", "", NULL, NULL, 0, 0 },
display_debug_frames, 1, 1 },
{ { ".debug_macinfo", NULL, 0, 0 },
{ { ".debug_macinfo", ".zdebug_macinfo", NULL, NULL, 0, 0 },
display_debug_macinfo, 0, 0 },
{ { ".debug_str", NULL, 0, 0 },
{ { ".debug_str", ".zdebug_str", NULL, NULL, 0, 0 },
display_debug_str, 0, 0 },
{ { ".debug_loc", NULL, 0, 0 },
{ { ".debug_loc", ".zdebug_loc", NULL, NULL, 0, 0 },
display_debug_loc, 0, 0 },
{ { ".debug_pubtypes", NULL, 0, 0 },
{ { ".debug_pubtypes", ".zdebug_pubtypes", NULL, NULL, 0, 0 },
display_debug_pubnames, 0, 0 },
{ { ".debug_ranges", NULL, 0, 0 },
{ { ".debug_ranges", ".zdebug_ranges", NULL, NULL, 0, 0 },
display_debug_ranges, 0, 0 },
{ { ".debug_static_func", NULL, 0, 0 },
{ { ".debug_static_func", ".zdebug_static_func", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 },
{ { ".debug_static_vars", NULL, 0, 0 },
{ { ".debug_static_vars", ".zdebug_static_vars", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 },
{ { ".debug_types", NULL, 0, 0 },
{ { ".debug_types", ".zdebug_types", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 },
{ { ".debug_weaknames", NULL, 0, 0 },
{ { ".debug_weaknames", ".zdebug_weaknames", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 }
};

View File

@ -1,4 +1,4 @@
/* dwwrf.h - DWARF support header file
/* dwarf.h - DWARF support header file
Copyright 2005, 2007, 2008
Free Software Foundation, Inc.
@ -31,7 +31,13 @@ typedef unsigned long dwarf_size_type;
struct dwarf_section
{
const char *name;
/* A debug section has a different name when it's stored compressed
* or not. COMPRESSED_NAME and UNCOMPRESSED_NAME are the two
* possibilities. NAME is set to whichever one is used for this
* input file, as determined by load_debug_section(). */
const char *uncompressed_name;
const char *compressed_name;
const char* name;
unsigned char *start;
dwarf_vma address;
dwarf_size_type size;

View File

@ -2062,13 +2062,28 @@ load_debug_section (enum dwarf_section_display_enum debug, void *file)
bfd *abfd = file;
asection *sec;
bfd_boolean ret;
int section_is_compressed;
/* If it is already loaded, do nothing. */
if (section->start != NULL)
return 1;
/* Locate the debug section. */
sec = bfd_get_section_by_name (abfd, section->name);
sec = bfd_get_section_by_name (abfd, section->uncompressed_name);
if (sec != NULL)
{
section->name = section->uncompressed_name;
section_is_compressed = 0;
}
else
{
sec = bfd_get_section_by_name (abfd, section->compressed_name);
if (sec != NULL)
{
section->name = section->compressed_name;
section_is_compressed = 1;
}
}
if (sec == NULL)
return 0;
@ -2097,11 +2112,24 @@ load_debug_section (enum dwarf_section_display_enum debug, void *file)
ret = bfd_get_section_contents (abfd, sec, section->start, 0,
section->size);
if (!ret)
if (! ret)
{
free_debug_section (debug);
printf (_("\nCan't get contents for section '%s'.\n"),
section->name);
return 0;
}
if (section_is_compressed)
{
bfd_size_type size = section->size;
if (! bfd_uncompress_section_contents (&section->start, &size))
{
free_debug_section (debug);
printf (_("\nCan't uncompress section '%s'.\n"), section->name);
return 0;
}
section->size = size;
}
return ret;
@ -2135,15 +2163,16 @@ dump_dwarf_section (bfd *abfd, asection *section,
match = name;
for (i = 0; i < max; i++)
if (strcmp (debug_displays[i].section.name, match) == 0)
if (strcmp (debug_displays [i].section.uncompressed_name, match) == 0
|| strcmp (debug_displays [i].section.compressed_name, match) == 0)
{
if (!debug_displays[i].eh_frame)
if (!debug_displays [i].eh_frame)
{
struct dwarf_section *sec = &debug_displays [i].section;
if (load_debug_section (i, abfd))
{
debug_displays[i].display (sec, abfd);
debug_displays [i].display (sec, abfd);
if (i != info && i != abbrev)
free_debug_section (i);
@ -2153,7 +2182,7 @@ dump_dwarf_section (bfd *abfd, asection *section,
}
}
static const char *mach_o_dwarf_sections [] = {
static const char *mach_o_uncompressed_dwarf_sections [] = {
"LC_SEGMENT.__DWARFA.__debug_abbrev", /* .debug_abbrev */
"LC_SEGMENT.__DWARFA.__debug_aranges", /* .debug_aranges */
"LC_SEGMENT.__DWARFA.__debug_frame", /* .debug_frame */
@ -2172,7 +2201,27 @@ static const char *mach_o_dwarf_sections [] = {
"LC_SEGMENT.__DWARFA.__debug_weaknames" /* .debug_weaknames */
};
static const char *generic_dwarf_sections [max];
static const char *mach_o_compressed_dwarf_sections [] = {
"LC_SEGMENT.__DWARFA.__zdebug_abbrev", /* .zdebug_abbrev */
"LC_SEGMENT.__DWARFA.__zdebug_aranges", /* .zdebug_aranges */
"LC_SEGMENT.__DWARFA.__zdebug_frame", /* .zdebug_frame */
"LC_SEGMENT.__DWARFA.__zdebug_info", /* .zdebug_info */
"LC_SEGMENT.__DWARFA.__zdebug_line", /* .zdebug_line */
"LC_SEGMENT.__DWARFA.__zdebug_pubnames", /* .zdebug_pubnames */
".eh_frame", /* .eh_frame */
"LC_SEGMENT.__DWARFA.__zdebug_macinfo", /* .zdebug_macinfo */
"LC_SEGMENT.__DWARFA.__zdebug_str", /* .zdebug_str */
"LC_SEGMENT.__DWARFA.__zdebug_loc", /* .zdebug_loc */
"LC_SEGMENT.__DWARFA.__zdebug_pubtypes", /* .zdebug_pubtypes */
"LC_SEGMENT.__DWARFA.__zdebug_ranges", /* .zdebug_ranges */
"LC_SEGMENT.__DWARFA.__zdebug_static_func", /* .zdebug_static_func */
"LC_SEGMENT.__DWARFA.__zdebug_static_vars", /* .zdebug_static_vars */
"LC_SEGMENT.__DWARFA.__zdebug_types", /* .zdebug_types */
"LC_SEGMENT.__DWARFA.__zdebug_weaknames" /* .zdebug_weaknames */
};
static const char *generic_uncompressed_dwarf_sections [max];
static const char *generic_compressed_dwarf_sections [max];
static void
check_mach_o_dwarf (bfd *abfd)
@ -2181,18 +2230,33 @@ check_mach_o_dwarf (bfd *abfd)
enum bfd_flavour current_flavour = bfd_get_flavour (abfd);
enum dwarf_section_display_enum i;
if (generic_dwarf_sections [0] == NULL)
if (generic_uncompressed_dwarf_sections [0] == NULL)
for (i = 0; i < max; i++)
generic_dwarf_sections [i] = debug_displays[i].section.name;
{
generic_uncompressed_dwarf_sections [i]
= debug_displays[i].section.uncompressed_name;
generic_compressed_dwarf_sections [i]
= debug_displays[i].section.compressed_name;
}
if (old_flavour != current_flavour)
{
if (current_flavour == bfd_target_mach_o_flavour)
for (i = 0; i < max; i++)
debug_displays[i].section.name = mach_o_dwarf_sections [i];
{
debug_displays[i].section.uncompressed_name
= mach_o_uncompressed_dwarf_sections [i];
debug_displays[i].section.compressed_name
= mach_o_compressed_dwarf_sections [i];
}
else if (old_flavour == bfd_target_mach_o_flavour)
for (i = 0; i < max; i++)
debug_displays[i].section.name = generic_dwarf_sections [i];
{
debug_displays[i].section.uncompressed_name
= generic_uncompressed_dwarf_sections [i];
debug_displays[i].section.compressed_name
= generic_compressed_dwarf_sections [i];
}
old_flavour = current_flavour;
}

View File

@ -41,10 +41,14 @@
ELF file than is provided by objdump. In particular it can display DWARF
debugging information which (at the moment) objdump cannot. */
#include "config.h"
#include "sysdep.h"
#include <assert.h>
#include <sys/stat.h>
#include <time.h>
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
/* for PATH_MAX */
#ifdef HAVE_LIMITS_H
@ -4385,9 +4389,13 @@ process_section_headers (FILE *file)
|| do_debug_lines || do_debug_lines_decoded || do_debug_pubnames
|| do_debug_aranges || do_debug_frames || do_debug_macinfo
|| do_debug_str || do_debug_loc || do_debug_ranges)
&& const_strneq (name, ".debug_"))
&& (const_strneq (name, ".debug_")
|| const_strneq (name, ".zdebug_")))
{
name += 7;
if (name[1] == 'z')
name += sizeof (".zdebug_") - 1;
else
name += sizeof (".debug_") - 1;
if (do_debugging
|| (do_debug_info && streq (name, "info"))
@ -8349,6 +8357,78 @@ is_16bit_abs_reloc (unsigned int reloc_type)
}
}
/* Uncompresses a section that was compressed using zlib, in place.
* This is a copy of bfd_uncompress_section_contents, in bfd/compress.c */
static int
uncompress_section_contents (unsigned char **buffer, dwarf_size_type *size)
{
#ifndef HAVE_ZLIB_H
/* These are just to quiet gcc. */
buffer = 0;
size = 0;
return FALSE;
#else
dwarf_size_type compressed_size = *size;
unsigned char* compressed_buffer = *buffer;
dwarf_size_type uncompressed_size;
unsigned char* uncompressed_buffer;
z_stream strm;
int rc;
dwarf_size_type header_size = 12;
/* Read the zlib header. In this case, it should be "ZLIB" followed
by the uncompressed section size, 8 bytes in big-endian order. */
if (compressed_size < header_size
|| ! streq ((char*) compressed_buffer, "ZLIB"))
return 0;
uncompressed_size = compressed_buffer[4]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[5]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[6]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[7]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[8]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[9]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[10]; uncompressed_size <<= 8;
uncompressed_size += compressed_buffer[11];
/* It is possible the section consists of several compressed
buffers concatenated together, so we uncompress in a loop. */
strm.zalloc = NULL;
strm.zfree = NULL;
strm.opaque = NULL;
strm.avail_in = compressed_size - header_size;
strm.next_in = (Bytef*) compressed_buffer + header_size;
strm.avail_out = uncompressed_size;
uncompressed_buffer = xmalloc (uncompressed_size);
rc = inflateInit (&strm);
while (strm.avail_in > 0)
{
if (rc != Z_OK)
goto fail;
strm.next_out = ((Bytef*) uncompressed_buffer
+ (uncompressed_size - strm.avail_out));
rc = inflate (&strm, Z_FINISH);
if (rc != Z_STREAM_END)
goto fail;
rc = inflateReset (&strm);
}
rc = inflateEnd (&strm);
if (rc != Z_OK
|| strm.avail_out != 0)
goto fail;
free (compressed_buffer);
*buffer = uncompressed_buffer;
*size = uncompressed_size;
return 1;
fail:
free (uncompressed_buffer);
return 0;
#endif /* HAVE_ZLIB_H */
}
/* Apply relocations to a debug section. */
static void
@ -8491,13 +8571,28 @@ load_debug_section (enum dwarf_section_display_enum debug, void *file)
struct dwarf_section *section = &debug_displays [debug].section;
Elf_Internal_Shdr *sec;
char buf [64];
int section_is_compressed;
/* If it is already loaded, do nothing. */
if (section->start != NULL)
return 1;
/* Locate the debug section. */
sec = find_section (section->name);
sec = find_section (section->uncompressed_name);
if (sec != NULL)
{
section->name = section->uncompressed_name;
section_is_compressed = 0;
}
else
{
sec = find_section (section->compressed_name);
if (sec != NULL)
{
section->name = section->compressed_name;
section_is_compressed = 1;
}
}
if (sec == NULL)
return 0;
@ -8506,11 +8601,17 @@ load_debug_section (enum dwarf_section_display_enum debug, void *file)
section->size = sec->sh_size;
section->start = get_data (NULL, file, sec->sh_offset, 1,
sec->sh_size, buf);
if (section->start == NULL)
return 0;
if (section_is_compressed)
if (! uncompress_section_contents (&section->start, &section->size))
return 0;
if (debug_displays [debug].relocate)
debug_apply_relocations (file, sec, section->start);
return section->start != NULL;
return 1;
}
void
@ -8547,7 +8648,8 @@ display_debug_section (Elf_Internal_Shdr *section, FILE *file)
/* See if we know how to display the contents of this section. */
for (i = 0; i < max; i++)
if (streq (debug_displays[i].section.name, name))
if (streq (debug_displays[i].section.uncompressed_name, name)
|| streq (debug_displays[i].section.compressed_name, name))
{
struct dwarf_section *sec = &debug_displays [i].section;

View File

@ -1,3 +1,15 @@
2008-07-09 Craig Silverstein <csilvers@google.com>
* binutils-all/objdump.exp: Add test for objdump -s on a file
with a compressed debug section. Add test for objdump -W on a
file that contains a compressed debug section.
* binutils-all/readelf.exp: Call readelf_compressed_wa_test.
(readelf_compressed_wa_test): New function.
* binutils-all/dw2-compressed.S: New file.
* binutils-all/objdump.W: New file.
* binutils-all/objdump.s: New file.
* binutils-all/readelf.wa: New file.
2008-07-08 Kai Tietz <kai.tietz@onevision.com>
* binutils-all/objcopy.exp (copy_setup): Check if host-triplet

View File

@ -0,0 +1,218 @@
/* This testcase is derived from a similar test in GDB.
Copyright 2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This tests that gdb can read compressed sections. The contents
are a basic assembly file, but the .debug_abbrev section has been
comrpessed using zlib. */
/* Dummy function to provide debug information for. */
.text
.globl _start
_start:
.int 0
.Lbegin_text1:
.globl func_cu1
.type func_cu1, %function
func_cu1:
.Lbegin_func_cu1:
.int 0
.Lend_func_cu1:
.size func_cu1, .-func_cu1
.Lend_text1:
/* Debug information */
.section .debug_info
.Lcu1_begin:
/* CU header */
.4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
.Lcu1_start:
.2byte 2 /* DWARF Version */
.4byte .Labbrev1_begin /* Offset into abbrev section */
.byte 4 /* Pointer size */
/* CU die */
.uleb128 1 /* Abbrev: DW_TAG_compile_unit */
.4byte .Lline1_begin /* DW_AT_stmt_list */
.4byte .Lend_text1 /* DW_AT_high_pc */
.4byte .Lbegin_text1 /* DW_AT_low_pc */
.ascii "file1.txt\0" /* DW_AT_name */
.ascii "GNU C 3.3.3\0" /* DW_AT_producer */
.byte 1 /* DW_AT_language (C) */
/* func_cu1 */
.uleb128 2 /* Abbrev: DW_TAG_subprogram */
.byte 1 /* DW_AT_external */
.byte 1 /* DW_AT_decl_file */
.byte 2 /* DW_AT_decl_line */
.ascii "func_cu1\0" /* DW_AT_name */
.4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
.4byte .Lbegin_func_cu1 /* DW_AT_low_pc */
.4byte .Lend_func_cu1 /* DW_AT_high_pc */
.byte 1 /* DW_AT_frame_base: length */
.byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */
.Ltype_int:
.uleb128 3 /* Abbrev: DW_TAG_base_type */
.ascii "int\0" /* DW_AT_name */
.byte 4 /* DW_AT_byte_size */
.byte 5 /* DW_AT_encoding */
.byte 0 /* End of children of CU */
.Lcu1_end:
/* Line table */
.section .debug_line
.Lline1_begin:
.4byte .Lline1_end - .Lline1_start /* Initial length */
.Lline1_start:
.2byte 2 /* Version */
.4byte .Lline1_lines - .Lline1_hdr /* header_length */
.Lline1_hdr:
.byte 1 /* Minimum insn length */
.byte 1 /* default_is_stmt */
.byte 1 /* line_base */
.byte 1 /* line_range */
.byte 0x10 /* opcode_base */
/* Standard lengths */
.byte 0
.byte 1
.byte 1
.byte 1
.byte 1
.byte 0
.byte 0
.byte 0
.byte 1
.byte 0
.byte 0
.byte 1
.byte 0
.byte 0
.byte 0
/* Include directories */
.byte 0
/* File names */
.ascii "file1.txt\0"
.uleb128 0
.uleb128 0
.uleb128 0
.byte 0
.Lline1_lines:
.byte 0 /* DW_LNE_set_address */
.uleb128 5
.byte 2
.4byte .Lbegin_func_cu1
.byte 3 /* DW_LNS_advance_line */
.sleb128 3 /* ... to 4 */
.byte 1 /* DW_LNS_copy */
.byte 1 /* DW_LNS_copy (second time as an end-of-prologue marker) */
.byte 0 /* DW_LNE_set_address */
.uleb128 5
.byte 2
.4byte .Lend_func_cu1
.byte 0 /* DW_LNE_end_of_sequence */
.uleb128 1
.byte 1
.Lline1_end:
/* Abbrev table -- compressed */
.section .zdebug_abbrev
.Labbrev1_begin:
.ascii "ZLIB"
.4byte 0
.2byte 0
.byte 0
.byte 51
.byte 0x78
.byte 0x5e
.byte 0x63
.byte 0x14
.byte 0x64
.byte 0x14
.byte 0x60
.byte 0x13
.byte 0x62
.byte 0x14
.byte 0x64
.byte 0x64
.byte 0xe6
.byte 0x50
.byte 0xe5
.byte 0x10
.byte 0xe6
.byte 0x66
.byte 0x60
.byte 0x60
.byte 0xd2
.byte 0x63
.byte 0xb0
.byte 0xe7
.byte 0xb1
.byte 0xe2
.byte 0xb6
.byte 0xe6
.byte 0x66
.byte 0xe6
.byte 0xf0
.byte 0x14
.byte 0x16
.byte 0x64
.byte 0x14
.byte 0x62
.byte 0x74
.byte 0xe0
.byte 0x02
.byte 0x00
.byte 0x25
.byte 0x78
.byte 0x02
.byte 0x81
.byte 0x78
.byte 0x9c
.byte 0x63
.byte 0x60
.byte 0x60
.byte 0x56
.byte 0x61
.byte 0x60
.byte 0xe6
.byte 0xe0
.byte 0xe6
.byte 0xb6
.byte 0xe3
.byte 0x66
.byte 0x00
.byte 0x02
.byte 0x00
.byte 0x04
.byte 0x9c
.byte 0x00
.byte 0x92

View File

@ -0,0 +1,129 @@
tmpdir/dw2-compressed.o: file format .*
The section .debug_info contains:
Compilation Unit @ offset 0x0:
Length: 0x4e \(32-bit\)
Version: 2
Abbrev Offset: 0
Pointer Size: 4
<0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\)
< c> DW_AT_stmt_list : 0x0
<10> DW_AT_high_pc : 0x8
<14> DW_AT_low_pc : 0x4
<18> DW_AT_name : file1.txt
<22> DW_AT_producer : GNU C 3.3.3
<2e> DW_AT_language : 1 \(ANSI C\)
<1><2f>: Abbrev Number: 2 \(DW_TAG_subprogram\)
<30> DW_AT_external : 1
<31> DW_AT_decl_file : 1
<32> DW_AT_decl_line : 2
<33> DW_AT_name : func_cu1
<3c> DW_AT_type : <0x4a>
<40> DW_AT_low_pc : 0x4
<44> DW_AT_high_pc : 0x8
<48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5\)
<1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\)
<4b> DW_AT_name : int
<4f> DW_AT_byte_size : 4
<50> DW_AT_encoding : 5 \(signed\)
Raw dump of debug contents of section .debug_line:
Offset: 0x0
Length: 62
DWARF Version: 2
Prologue Length: 35
Minimum Instruction Length: 1
Initial value of 'is_stmt': 1
Line Base: 1
Line Range: 1
Opcode Base: 16
Opcodes:
Opcode 1 has 0 args
Opcode 2 has 1 args
Opcode 3 has 1 args
Opcode 4 has 1 args
Opcode 5 has 1 args
Opcode 6 has 0 args
Opcode 7 has 0 args
Opcode 8 has 0 args
Opcode 9 has 1 args
Opcode 10 has 0 args
Opcode 11 has 0 args
Opcode 12 has 1 args
Opcode 13 has 0 args
Opcode 14 has 0 args
Opcode 15 has 0 args
The Directory Table is empty.
The File Name Table:
Entry Dir Time Size Name
1 0 0 0 file1.txt
Line Number Statements:
Extended opcode 2: set Address to .*
Advance Line by 3 to 4
Copy
Copy
Extended opcode 2: set Address to .*
Extended opcode 1: End of Sequence
Offset: 0x42
Length: 25
DWARF Version: 2
Prologue Length: 19
Minimum Instruction Length: 1
Initial value of 'is_stmt': 1
Line Base: -5
Line Range: 14
Opcode Base: 13
Opcodes:
Opcode 1 has 0 args
Opcode 2 has 1 args
Opcode 3 has 1 args
Opcode 4 has 1 args
Opcode 5 has 1 args
Opcode 6 has 0 args
Opcode 7 has 0 args
Opcode 8 has 0 args
Opcode 9 has 1 args
Opcode 10 has 0 args
Opcode 11 has 0 args
Opcode 12 has 1 args
The Directory Table is empty.
The File Name Table is empty.
Line Number Statements:
Contents of the .zdebug_abbrev section:
Number TAG
1 DW_TAG_compile_unit \[has children\]
DW_AT_stmt_list DW_FORM_data4
DW_AT_high_pc DW_FORM_addr
DW_AT_low_pc DW_FORM_addr
DW_AT_name DW_FORM_string
DW_AT_producer DW_FORM_string
DW_AT_language DW_FORM_data1
2 DW_TAG_subprogram \[no children\]
DW_AT_external DW_FORM_flag
DW_AT_decl_file DW_FORM_data1
DW_AT_decl_line DW_FORM_data1
DW_AT_name DW_FORM_string
DW_AT_type DW_FORM_ref4
DW_AT_low_pc DW_FORM_addr
DW_AT_high_pc DW_FORM_addr
DW_AT_frame_base DW_FORM_block1
3 DW_TAG_base_type \[no children\]
DW_AT_name DW_FORM_string
DW_AT_byte_size DW_FORM_data1
DW_AT_encoding DW_FORM_data1

View File

@ -158,6 +158,49 @@ if [regexp $want $got] then {
fail "objdump -s"
}
# Test objdump -s on a file that contains a compressed .debug section
if {![binutils_assemble $srcdir/$subdir/dw2-compressed.S tmpdir/dw2-compressed.o]} then {
return
}
if [is_remote host] {
set compressed_testfile [remote_download host tmpdir/dw2-compressed.o]
} else {
set compressed_testfile tmpdir/dw2-compressed.o
}
set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -s -j .zdebug_abbrev $compressed_testfile" "" "/dev/null" "objdump.out"]
if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
fail "objdump -s -j .zdebug_abbrev (reason: unexpected output)"
send_log $got
send_log "\n"
}
if { [regexp_diff objdump.out $srcdir/$subdir/objdump.s] } then {
fail "objdump -s -j .zdebug_abbrev"
} else {
pass "objdump -s -j .zdebug_abbrev"
}
# Test objdump -W on a file that contains some compressed .debug sections
set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -W $compressed_testfile" "" "/dev/null" "objdump.out"]
if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
fail "objdump -W (reason: unexpected output)"
send_log $got
send_log "\n"
}
if { [regexp_diff objdump.out $srcdir/$subdir/objdump.W] } then {
fail "objdump -W"
} else {
pass "objdump -W"
}
# Options which are not tested: -a -d -D -R -T -x -l --stabs
# I don't see any generic way to test any of these other than -a.
# Tests could be written for specific targets, and that should be done

View File

@ -0,0 +1,9 @@
tmpdir/dw2-compressed.o: file format .*
Contents of section .zdebug_abbrev:
0000 5a4c4942 00000000 00000033 785e6314 ZLIB.......3x\^c.
0010 64146013 62146464 e650e510 e6666060 d.`.b.dd.P...f``
0020 d263b0e7 b1e2b6e6 66e6f014 16641462 .c......f....d.b
0030 74e00200 25780281 789c6360 60566160 t...%x..x.c``Va`
0040 e6e0e6b6 e3660002 00049c00 92 .....f.......

View File

@ -208,6 +208,42 @@ proc readelf_wi_test {} {
pass "readelf -wi"
}
# This tests "readelf -wa", but on a file with a compressed
# .debug_abbrev section.
proc readelf_compressed_wa_test {} {
global READELF
global READELFFLAGS
global srcdir
global subdir
# Compile the compressed-debug-section test file.
if { [target_compile $srcdir/$subdir/dw2-compressed.S tmpdir/dw2-compressed.o object debug] != "" } {
verbose "Unable to compile test file."
untested "readelf -wa (compressed)"
return
}
# Download it.
set tempfile [remote_download host tmpdir/dw2-compressed.o]
# Run "readelf -wa" on it.
set got [remote_exec host "$READELF $READELFFLAGS -wa $tempfile" "" "/dev/null" "readelf.out"]
# Upload the results.
set output [remote_upload host readelf.out]
file_on_host delete $tempfile
if { [string compare [file_contents readelf.out] [file_contents $srcdir/$subdir/readelf.wa]] != 0 } then {
fail "readelf -wa (compressed)"
verbose "output is \n[file_contents readelf.out]" 2
verbose "expected is \n[file_contents $srcdir/$subdir/readelf.wa]" 2
return
}
pass "readelf -wa (compressed)"
}
# Test readelf's dumping abilities.
@ -295,5 +331,6 @@ readelf_test -s $tempfile readelf.ss {}
readelf_test -r $tempfile readelf.r {}
readelf_wi_test
readelf_compressed_wa_test
readelf_dump_test

View File

@ -0,0 +1,24 @@
Contents of the .zdebug_abbrev section:
Number TAG
1 DW_TAG_compile_unit [has children]
DW_AT_stmt_list DW_FORM_data4
DW_AT_high_pc DW_FORM_addr
DW_AT_low_pc DW_FORM_addr
DW_AT_name DW_FORM_string
DW_AT_producer DW_FORM_string
DW_AT_language DW_FORM_data1
2 DW_TAG_subprogram [no children]
DW_AT_external DW_FORM_flag
DW_AT_decl_file DW_FORM_data1
DW_AT_decl_line DW_FORM_data1
DW_AT_name DW_FORM_string
DW_AT_type DW_FORM_ref4
DW_AT_low_pc DW_FORM_addr
DW_AT_high_pc DW_FORM_addr
DW_AT_frame_base DW_FORM_block1
3 DW_TAG_base_type [no children]
DW_AT_name DW_FORM_string
DW_AT_byte_size DW_FORM_data1
DW_AT_encoding DW_FORM_data1