aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2020-10-28 18:41:24 +0100
committerThomas Koenig <tkoenig@gcc.gnu.org>2020-10-28 18:41:24 +0100
commitbf6dad60c338a42a7fb85f7b2a5870c0fb2e20f8 (patch)
treee513781ef717465e7db0358e987a5a6cbef5665c /libiberty
parent0c261d5b5c931d9e9214d06531bdc7e9e16aeaab (diff)
parent47d13acbda9a5d8eb57ff169ba74857cd54108e4 (diff)
downloadgcc-bf6dad60c338a42a7fb85f7b2a5870c0fb2e20f8.zip
gcc-bf6dad60c338a42a7fb85f7b2a5870c0fb2e20f8.tar.gz
gcc-bf6dad60c338a42a7fb85f7b2a5870c0fb2e20f8.tar.bz2
Merge branch 'master' into devel/coarray_native.
Merge into devel/coarray_native to prepare for later merging of coarray_native with master.
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog11
-rw-r--r--libiberty/dwarfnames.c7
-rw-r--r--libiberty/simple-object-elf.c11
3 files changed, 25 insertions, 4 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index a5e09d8..aae51b8 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,14 @@
+2020-10-06 Martin Liska <mliska@suse.cz>
+
+ PR lto/97290
+ * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
+ Use sh_link of a .symtab_shndx section.
+
+2020-09-24 Mark Wielaard <mark@klomp.org>
+
+ * dwarfnames.c (get_DW_UT_name): Define using DW_UT_FIRST, DW_UT
+ and DW_UT_END.
+
2020-09-08 Felix Willgerodt <felix.willgerodt@intel.com>
* floatformat.c (floatformat_bfloat16_big): New.
diff --git a/libiberty/dwarfnames.c b/libiberty/dwarfnames.c
index 968d191..af11668 100644
--- a/libiberty/dwarfnames.c
+++ b/libiberty/dwarfnames.c
@@ -64,6 +64,11 @@ Boston, MA 02110-1301, USA. */
switch (idx) { \
DW_IDX (name, value)
#define DW_END_IDX } return 0; }
+#define DW_FIRST_UT(name, value) \
+ const char *get_DW_UT_name (unsigned int ut) { \
+ switch (ut) { \
+ DW_UT (name, value)
+#define DW_END_UT } return 0; }
#define DW_TAG(name, value) case name: return # name ;
#define DW_TAG_DUP(name, value)
@@ -78,6 +83,7 @@ Boston, MA 02110-1301, USA. */
#define DW_CFA_DUP(name, value)
#define DW_IDX(name, value) case name: return # name ;
#define DW_IDX_DUP(name, value)
+#define DW_UT(name, value) case name: return # name ;
#include "dwarf2.def"
@@ -95,6 +101,7 @@ Boston, MA 02110-1301, USA. */
#undef DW_END_CFA
#undef DW_FIRST_IDX
#undef DW_END_IDX
+#undef DW_END_UT
#undef DW_TAG
#undef DW_TAG_DUP
diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c
index 7c9d492..37e7334 100644
--- a/libiberty/simple-object-elf.c
+++ b/libiberty/simple-object-elf.c
@@ -1191,7 +1191,7 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
unsigned int sh_link;
sh_link = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
shdr, sh_link, Elf_Word);
- symtab_indices_shndx[sh_link - 1] = i;
+ symtab_indices_shndx[sh_link - 1] = i - 1;
/* Always discard the extended index sections, after
copying it will not be needed. This way we don't need to
update it and deal with the ordering constraints of
@@ -1372,19 +1372,22 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
{
unsigned entsize = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
shdr, sh_entsize, Elf_Addr);
- unsigned strtab = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
- shdr, sh_link, Elf_Word);
size_t prevailing_name_idx = 0;
unsigned char *ent;
unsigned *shndx_table = NULL;
/* Read the section index table if present. */
if (symtab_indices_shndx[i - 1] != 0)
{
- unsigned char *sidxhdr = shdrs + (strtab - 1) * shdr_size;
+ unsigned char *sidxhdr = shdrs + symtab_indices_shndx[i - 1] * shdr_size;
off_t sidxoff = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
sidxhdr, sh_offset, Elf_Addr);
size_t sidxsz = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
sidxhdr, sh_size, Elf_Addr);
+ unsigned int shndx_type
+ = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
+ sidxhdr, sh_type, Elf_Word);
+ if (shndx_type != SHT_SYMTAB_SHNDX)
+ return "Wrong section type of a SYMTAB SECTION INDICES section";
shndx_table = (unsigned *)XNEWVEC (char, sidxsz);
simple_object_internal_read (sobj->descriptor,
sobj->offset + sidxoff,