From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94536 invoked by alias); 20 Nov 2016 20:10:37 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 94516 invoked by uid 9674); 20 Nov 2016 20:10:37 -0000 Date: Sun, 20 Nov 2016 20:10:00 -0000 Message-ID: <20161120201036.94477.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] users/jkratoch/dwarf5gcc-gdb: Merge branch 'dwarf5gcc-gdb-callsite-macro' into dwarf5gcc-gdb-callsite-macro-data16 X-Git-Refname: refs/heads/users/jkratoch/dwarf5gcc-gdb X-Git-Reftype: branch X-Git-Oldrev: 4de1309af9f379170f616819c68e1fcb8cab8f06 X-Git-Newrev: c67ca28e3fc01491846ad1e27ff20c8f807b6c27 X-SW-Source: 2016-q4/txt/msg00026.txt.bz2 List-Id: The branch, users/jkratoch/dwarf5gcc-gdb has been updated via c67ca28e3fc01491846ad1e27ff20c8f807b6c27 (commit) via 6f3facd36a83edfa624d7d5d51c6018dc78968a4 (commit) via 11b76f044a9b0cde1687b1621d3c990f9986b307 (commit) via 3f99f9ecbd18de2ec31fe815780241d08a8aa035 (commit) via 76a29a45db928e68e1faf83d9c7008cc29543e65 (commit) via b96beb3fc533ffeb0aadaee6d8445938287305af (commit) via b5fbed8982b47d1ea5a0435c156e488e24e9d67c (commit) via cc188e5fd6d4f8d3061ed6c58c432a150f7966e9 (commit) via 0fc9967d0b28a1e037233d49cec479d3ab1e9e59 (commit) from 4de1309af9f379170f616819c68e1fcb8cab8f06 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit c67ca28e3fc01491846ad1e27ff20c8f807b6c27 Merge: 4de1309 6f3facd Author: Jan Kratochvil Date: Sun Nov 20 21:10:21 2016 +0100 Merge branch 'dwarf5gcc-gdb-callsite-macro' into dwarf5gcc-gdb-callsite-macro-data16 commit 6f3facd36a83edfa624d7d5d51c6018dc78968a4 Merge: 5f57cb5 11b76f0 Author: Jan Kratochvil Date: Sun Nov 20 21:10:21 2016 +0100 Merge branch 'dwarf5gcc-gdb-callsite' into dwarf5gcc-gdb-callsite-macro commit 11b76f044a9b0cde1687b1621d3c990f9986b307 Merge: 7be994b 3f99f9e Author: Jan Kratochvil Date: Sun Nov 20 21:10:20 2016 +0100 Merge branch 'dwarf5gcc-gdb' into dwarf5gcc-gdb-callsite commit 3f99f9ecbd18de2ec31fe815780241d08a8aa035 Merge: b96beb3 76a29a4 Author: Jan Kratochvil Date: Sun Nov 20 21:10:20 2016 +0100 Merge branch 'dwarf5gcc' into dwarf5gcc-gdb commit b96beb3fc533ffeb0aadaee6d8445938287305af Author: Jan Kratochvil Date: Sun Nov 20 21:10:03 2016 +0100 . ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 5 ++++ bfd/elfxx-sparc.c | 16 +++++++------- bfd/version.h | 2 +- gdb/ChangeLog | 5 ++++ gdb/contrib/ari/gdb_ari.sh | 16 ++++++++++++++ gdb/dwarf2read.c | 50 +++++++++++++++++++++++++++++--------------- 6 files changed, 68 insertions(+), 26 deletions(-) First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8a18a6d..f28351d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-11-19 Jose E. Marchesi + + * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Do not + apply the negative GOT offset optimization in 64-bit code. + 2016-11-18 James Clarke * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Don't convert diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index e1c7b22..cf30012 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -2661,19 +2661,19 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, /* Allocate .plt and .got entries, and space for local symbols. */ htab_traverse (htab->loc_hash_table, allocate_local_dynrelocs, info); - if (!htab->is_vxworks + if (! ABI_64_P (output_bfd) + && !htab->is_vxworks && elf_hash_table (info)->dynamic_sections_created) { - if (! ABI_64_P (output_bfd)) - { - /* Make space for the trailing nop in .plt. */ - if (htab->elf.splt->size > 0) - htab->elf.splt->size += 1 * SPARC_INSN_BYTES; - } + /* Make space for the trailing nop in .plt. */ + if (htab->elf.splt->size > 0) + htab->elf.splt->size += 1 * SPARC_INSN_BYTES; /* If the .got section is more than 0x1000 bytes, we add 0x1000 to the value of _GLOBAL_OFFSET_TABLE_, so that 13 - bit relocations have a greater chance of working. */ + bit relocations have a greater chance of working. + + FIXME: Make this optimization work for 64-bit too. */ if (htab->elf.sgot->size >= 0x1000 && elf_hash_table (info)->hgot->root.u.def.value == 0) elf_hash_table (info)->hgot->root.u.def.value = 0x1000; diff --git a/bfd/version.h b/bfd/version.h index 071f655..a8f63a5 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20161119 +#define BFD_VERSION_DATE 20161120 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 07d21a6..3797e8b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-11-19 Joel Brobecker + + * contrib/ari/gdb_ari.sh: Add detection of printf_vma and + sprintf_vma. + 2016-11-18 Simon Marchi * Makefile.in (%.o: $(srcdir)/gdbtk/generic/%.c): Fix typo. diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh index 7e639e3..2ecc0d6 100755 --- a/gdb/contrib/ari/gdb_ari.sh +++ b/gdb/contrib/ari/gdb_ari.sh @@ -1097,6 +1097,22 @@ Do not use vasprintf(), instead use xstrvprintf" fail("vasprintf") } +BEGIN { doc["printf_vma"] = "\ +Do not use printf_vma, instead use paddress or phex_nz" + category["printf_vma"] = ari_code +} +/(^|[^_[:alnum:]])printf_vma[[:space:]]*\(/ { + fail("printf_vma") +} + +BEGIN { doc["sprintf_vma"] = "\ +Do not use sprintf_vma, instead use paddress or phex_nz" + category["sprintf_vma"] = ari_code +} +/(^|[^_[:alnum:]])sprintf_vma[[:space:]]*\(/ { + fail("sprintf_vma") +} + # More generic memory operations BEGIN { doc["bzero"] = "\ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 7008f2c..7978289 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1883,11 +1883,12 @@ static void find_file_and_directory (struct die_info *die, static char *file_full_name (int file, struct line_header *lh, const char *comp_dir); +enum class RCUH_Kind { COMPILE, TYPE }; static const gdb_byte *read_and_check_comp_unit_head (struct comp_unit_head *header, struct dwarf2_section_info *section, struct dwarf2_section_info *abbrev_section, const gdb_byte *info_ptr, - int is_debug_types_section); + RCUH_Kind section_kind); static void init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, struct abbrev_table *abbrev_table, @@ -4384,8 +4385,6 @@ dwarf2_find_base_address (struct die_info *die, struct dwarf2_cu *cu) NOTE: This leaves members offset, first_die_offset to be filled in by the caller. */ -enum class RCUH_Kind { COMPILE, TYPE }; - static const gdb_byte * read_comp_unit_head (struct comp_unit_head *cu_header, const gdb_byte *info_ptr, @@ -4403,7 +4402,20 @@ read_comp_unit_head (struct comp_unit_head *cu_header, info_ptr += bytes_read; cu_header->version = read_2_bytes (abfd, info_ptr); info_ptr += 2; - if (cu_header->version >= 5) + if (cu_header->version < 5) + switch (section_kind) + { + case RCUH_Kind::COMPILE: + cu_header->unit_type = DW_UT_compile; + break; + case RCUH_Kind::TYPE: + cu_header->unit_type = DW_UT_type; + break; + default: + internal_error (__FILE__, __LINE__, + _("read_comp_unit_head: invalid section_kind")); + } + else { cu_header->unit_type = static_cast (read_1_byte (abfd, info_ptr)); @@ -4530,16 +4542,14 @@ read_and_check_comp_unit_head (struct comp_unit_head *header, struct dwarf2_section_info *section, struct dwarf2_section_info *abbrev_section, const gdb_byte *info_ptr, - int is_debug_types_section) + RCUH_Kind section_kind) { const gdb_byte *beg_of_comp_unit = info_ptr; bfd *abfd = get_section_bfd_owner (section); header->offset.sect_off = beg_of_comp_unit - section->buffer; - info_ptr = read_comp_unit_head (header, info_ptr, section, - is_debug_types_section ? RCUH_Kind::TYPE - : RCUH_Kind::COMPILE); + info_ptr = read_comp_unit_head (header, info_ptr, section, section_kind); header->first_die_offset.cu_off = info_ptr - beg_of_comp_unit; @@ -4688,7 +4698,8 @@ add_signatured_type_cu_to_table (void **slot, void *datum) static void create_debug_type_hash_table (struct dwo_file *dwo_file, - dwarf2_section_info *section, htab_t &types_htab) + dwarf2_section_info *section, htab_t &types_htab, + RCUH_Kind section_kind) { struct objfile *objfile = dwarf2_per_objfile->objfile; struct dwarf2_section_info *abbrev_section; @@ -4735,7 +4746,7 @@ create_debug_type_hash_table (struct dwo_file *dwo_file, table, but we don't need anything else just yet. */ ptr = read_and_check_comp_unit_head (&header, section, - abbrev_section, ptr, 0); + abbrev_section, ptr, section_kind); length = get_cu_length (&header); @@ -4847,7 +4858,8 @@ create_debug_types_hash_table (struct dwo_file *dwo_file, for (ix = 0; VEC_iterate (dwarf2_section_info_def, types, ix, section); ++ix) - create_debug_type_hash_table (dwo_file, section, types_htab); + create_debug_type_hash_table (dwo_file, section, types_htab, + RCUH_Kind::TYPE); } /* Create the hash table of all entries in the .debug_types section, @@ -4861,7 +4873,8 @@ create_all_type_units (struct objfile *objfile) htab_t types_htab = NULL; struct signatured_type **iter; - create_debug_type_hash_table (NULL, &dwarf2_per_objfile->info, types_htab); + create_debug_type_hash_table (NULL, &dwarf2_per_objfile->info, types_htab, + RCUH_Kind::COMPILE); create_debug_types_hash_table (NULL, dwarf2_per_objfile->types, types_htab); if (types_htab == NULL) { @@ -5246,7 +5259,7 @@ read_cutu_die_from_dwo (struct dwarf2_per_cu_data *this_cu, info_ptr = read_and_check_comp_unit_head (&cu->header, section, dwo_abbrev_section, - info_ptr, 1); + info_ptr, RCUH_Kind::TYPE); /* This is not an assert because it can be caused by bad debug info. */ if (sig_type->signature != cu->header.signature) { @@ -5272,7 +5285,7 @@ read_cutu_die_from_dwo (struct dwarf2_per_cu_data *this_cu, { info_ptr = read_and_check_comp_unit_head (&cu->header, section, dwo_abbrev_section, - info_ptr, 0); + info_ptr, RCUH_Kind::COMPILE); gdb_assert (dwo_unit->offset.sect_off == cu->header.offset.sect_off); /* For DWOs coming from DWP files, we don't know the CU length until now. */ @@ -5593,7 +5606,7 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, { info_ptr = read_and_check_comp_unit_head (&cu->header, section, abbrev_section, info_ptr, - 1); + RCUH_Kind::TYPE); /* Since per_cu is the first member of struct signatured_type, we can go from a pointer to one to a pointer to the other. */ @@ -5617,7 +5630,8 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, { info_ptr = read_and_check_comp_unit_head (&cu->header, section, abbrev_section, - info_ptr, 0); + info_ptr, + RCUH_Kind::COMPILE); gdb_assert (this_cu->offset.sect_off == cu->header.offset.sect_off); gdb_assert (this_cu->length == get_cu_length (&cu->header)); @@ -5783,7 +5797,9 @@ init_cutu_and_read_dies_no_follow (struct dwarf2_per_cu_data *this_cu, begin_info_ptr = info_ptr = section->buffer + this_cu->offset.sect_off; info_ptr = read_and_check_comp_unit_head (&cu.header, section, abbrev_section, info_ptr, - this_cu->is_debug_types); + (this_cu->is_debug_types + ? RCUH_Kind::TYPE + : RCUH_Kind::COMPILE)); this_cu->length = get_cu_length (&cu.header); hooks/post-receive -- Repository for Project Archer.