diff options
author | Nick Clifton <nickc@redhat.com> | 2019-08-09 16:16:18 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2019-08-09 16:16:18 +0100 |
commit | f211b8c0b91fc7b1657079a495f05a9a4d957821 (patch) | |
tree | 5f7d086cc3f1615bcf43c5d6f9054a4f104fca6d /libiberty/simple-object-elf.c | |
parent | f16a9783c5f085443d806646074e9c06fdee9a88 (diff) | |
download | fsf-binutils-gdb-f211b8c0b91fc7b1657079a495f05a9a4d957821.zip fsf-binutils-gdb-f211b8c0b91fc7b1657079a495f05a9a4d957821.tar.gz fsf-binutils-gdb-f211b8c0b91fc7b1657079a495f05a9a4d957821.tar.bz2 |
Synchronize libiberty sources with gcc mainline.
* libiberty: Sync with gcc. Bring in:
2019-08-08 Martin Liska <mliska@suse.cz>
PR bootstrap/91352
* lrealpath.c (is_valid_fd): New function.
2019-07-24 Martin Liska <mliska@suse.cz>
PR lto/91228
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
Find first '\0' starting from gnu_lto + 1.
2019-07-12 Ren Kimura <rkx1209dev@gmail.com>
* simple-object-elf.c (simple_object_elf_match): Check zero value shstrndx.
This fixes a Bug 90924.
2019-07-22 Martin Liska <mliska@suse.cz>
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
Do not search for gnu_lto_v1, but search for first '\0'.
2019-07-18 Eduard-Mihai Burtescu <eddyb@lyken.rs>
* cplus-dem.c: Include rust-demangle.h.
* rust-demangle.c: Include rust-demangle.h.
* rust-demangle.h: New file.
2019-05-31 Michael Forney <mforney@mforney.org>
* cp-demangle.c: Don't define CP_DYNAMIC_ARRAYS if __STDC_NO_VLA__
is non-zero.
2019-04-30 Ben L <bobsayshilol@live.co.uk>
* d-demangle.c (dlang_parse_assocarray): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.
* d-demangle.c (dlang_parse_tuple): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.
* d-demangle.c (dlang_parse_structlit): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.
* d-demangle.c (dlang_parse_arrayliteral): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.
* d-demangle.c (dlang_parse_integer): Fix stack underflow.
* testsuite/d-demangle-expected: Add testcase.
* cp-demangle (d_print_comp_inner): Guard against a NULL 'typed_name'.
* testsuite/demangle-expected: Add testcase.
* cp-demangle.c (d_encoding): Guard against NULL return values from
d_right (dc).
* testsuite/demangle-expected: Add testcase.
2019-04-29 Ben L <bobsayshilol@live.co.uk>
* cp-demangle.c (d_expression_1): Don't peek ahead unless the current
char is valid.
* testsuite/demangle-expected: Add testcase.
2019-04-10 Nick Clifton <nickc@redhat.com>
PR 89394
* cp-demangle.c (cplus_demangle_fill_name): Reject negative
lengths.
(d_count_templates_scopes): Replace num_templates and num_scopes
parameters with a struct d_print_info pointer parameter. Adjust
body of the function accordingly. Add recursion counter and check
that the recursion limit is not reached.
(d_print_init): Pass dpi parameter to d_count_templates_scopes.
Reset recursion counter afterwards, unless the recursion limit was
reached.
Diffstat (limited to 'libiberty/simple-object-elf.c')
-rw-r--r-- | libiberty/simple-object-elf.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c index 22c9ae7..7515926 100644 --- a/libiberty/simple-object-elf.c +++ b/libiberty/simple-object-elf.c @@ -548,7 +548,15 @@ simple_object_elf_match (unsigned char header[SIMPLE_OBJECT_MATCH_HEADER_LEN], XDELETE (eor); return NULL; } - + + if (eor->shstrndx == 0) + { + *errmsg = "invalid ELF shstrndx == 0"; + *err = 0; + XDELETE (eor); + return NULL; + } + return (void *) eor; } @@ -1358,9 +1366,8 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj, return errmsg; } - /* If we are processing .symtab purge __gnu_lto_v1 and - __gnu_lto_slim symbols from it and any symbols in discarded - sections. */ + /* If we are processing .symtab purge __gnu_lto_slim symbol + from it and any symbols in discarded sections. */ if (sh_type == SHT_SYMTAB) { unsigned entsize = ELF_FETCH_FIELD (type_functions, ei_class, Shdr, @@ -1380,14 +1387,9 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj, sobj->offset + stroff, (unsigned char *)strings, strsz, &errmsg, err); - /* Find gnu_lto_ in strings. */ - while ((gnu_lto = (char *) memchr (gnu_lto, 'g', - strings + strsz - gnu_lto))) - if (strncmp (gnu_lto, "gnu_lto_v1", - strings + strsz - gnu_lto) == 0) - break; - else - gnu_lto++; + /* Find first '\0' in strings. */ + gnu_lto = (char *) memchr (gnu_lto + 1, '\0', + strings + strsz - gnu_lto); /* Read the section index table if present. */ if (symtab_indices_shndx[i - 1] != 0) { @@ -1461,10 +1463,9 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj, undefined and sharing the gnu_lto_ name. */ bind = STB_WEAK; other = STV_HIDDEN; - if (gnu_lto) - ELF_SET_FIELD (type_functions, ei_class, Sym, - ent, st_name, Elf_Word, - gnu_lto - strings); + ELF_SET_FIELD (type_functions, ei_class, Sym, + ent, st_name, Elf_Word, + gnu_lto - strings); ELF_SET_FIELD (type_functions, ei_class, Sym, ent, st_shndx, Elf_Half, SHN_UNDEF); } |