• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/mmetzger/fsgs
RSS
Rev. Time Author
d26f3c1 users/mmetzger/fsgs 2019-12-18 00:04:40 Markus Metzger

[wip] gdbserver, x86: support fs_base and gs_base

When debugging over gdbserver fs/gs_base is not updated when changing the
corresponding selector.

For 32-bit inferiors, fs/gs_base are now defined but not fetched.

Change-Id: I5a4d8637324ee5f0c303fdcc5eeb8ca50b96c577
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>

db18e24 2019-12-18 00:04:40 Markus Metzger

testsuite: add m32 board files

Add board files for running tests with 32-bit inferiors on 64-bit kernels.

Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>

gdb/testsuite/
* boards/m32.exp: New.
* boards/native-m32.exp: New.
* boards/native-gdbserver-m32.exp: New.

Change-Id: I998416e7e431529238b8ebe5ecfd8dee2e0d9e81

03bad9e 2019-12-18 00:04:40 Markus Metzger

gdb, testsuite: test changing FS and GS segment selectors and bases

Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>

testsuite/
* lib/gdb.exp (skip_fsgsbase_tests, skip_arch_set_fs_tests)
(skip_arch_set_gs_tests): New.
* gdb.arch/x86-fsgs.c: New.
* gdb.arch/x86-fsgs.exp: New.

Change-Id: I7da32d4b57fd8b34153e7385263ec82318d32a98

3e7fa95 2019-12-17 23:37:30 Markus Metzger

x86: support fs_base and gs_base for 32-bit inferiors on 64-bit kernels

On Linux 64-bit kernels provide fs_base and gs_base also for 32-bit
inferiors. Add support for those registers.

Also check for HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE consistently.

Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>

gdb/
* amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add FS_BASE
and GS_BASE offsets.
* amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Check
HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE.
(amd64_linux_read_description): Enable segments if
HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE.
* i386-linux-tdep.c (i386_linux_gregset_reg_offset): Add -1 for
FS_BASE and GS_BASE offsets.
(i386_linux_read_description): Enable segments if
HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE.
* i386-linux-tdep.h (I386_LINUX_ORIG_EAX_REGNUM): Update.

Change-Id: I030b500a7a5b087452a78c3e0545d6e6e65146aa

9db9f4a 2019-12-17 23:37:30 Markus Metzger

gdb, testsuite: add gdb_continue_to_breakpoint pattern

When setting a breakpoint on a function foo, GDB prints

Breakpoint 1, foo (...) at ...

Add a gdb_test_multiple pattern in gdb_continue_to_breakpoint to allow
defining the function name as location_pattern.

Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>

testsuite/
* lib/gdb.exp (gdb_continue_to_breakpoint): Add pattern.

Change-Id: I07f9389e1c9ff04891869fa223e144ea9d5097f3

eb7b504 2019-12-17 21:45:12 Alan Modra

ubsan: visium: left shift cannot be represented in type 'int'

* visium-dis.c (print_insn_visium): Avoid signed overflow.

29298bf 2019-12-17 21:28:19 Alan Modra

ubsan: aarch64: left shift cannot be represented in type 'int64_t'

* aarch64-opc.c (value_fit_signed_field_p): Avoid signed overflow.
(value_fit_unsigned_field_p): Likewise.
(aarch64_wide_constant_p): Likewise.
(operand_general_constraint_met_p): Likewise.
* aarch64-opc.h (aarch64_wide_constant_p): Update prototype.

e46d79a 2019-12-17 21:28:11 Alan Modra

ubsan: nds32: left shift cannot be represented in type 'int'

Yet more.

* nds32-dis.c (nds32_mask_opcode): Avoid signed overflow.
(print_insn_nds32): Use uint64_t for "given" and "given1".

660df28 2019-12-17 19:13:00 Alan Modra

Prefer object over notype symbols when disassembling

Changing objdump disassembly output like this always requires some
testsuite changes, with the avr and x64_64 changes simply due to
picking up better symbols, the whole point of the patch.

The mips changes are due to mips-sgi-irix changing STT_NOTYPE symbols
to STT_OBJECT, which objdump now chooses in preference to script
symbols. The problem is that objdump looks at the first symbol in the
section being disassembled, and if object type, just dumps out bytes
rather than disassembling. This results in new failures:

FAIL: JAL overflow 2
FAIL: undefined weak symbol overflow
FAIL: undefined weak symbol overflow (n32)
FAIL: undefined weak symbol overflow (n64)

So for mips-sgi-irix function symbols really do need to be function
type. I fixed a few more than just the required minimum to avoid the
above test fails.

binutils/
* objdump.c (compare_section): New static var.
(compare_symbols): Sort by current section only. Don't access
symbol name out of bounds when checking for file symbols.
Sort section symbols and object symbols.
(find_symbol_for_address): Remove bogus debugging and section
symbol test.
(disassemble_data): Move symbol sort from here..
(disassemble_section): ..to here. Set compare_section.
ld/
* testsuite/ld-avr/lds-mega.d: Adjust symbols to suit objdump change.
* testsuite/ld-avr/lds-tiny.d: Likewise.
* testsuite/ld-x86-64/load2.d: Likewise.
* testsuite/ld-mips-elf/compact-eh1.s: Give function symbols
function type.
* testsuite/ld-mips-elf/compact-eh1a.s: Likewise.
* testsuite/ld-mips-elf/compact-eh1b.s: Likewise.
* testsuite/ld-mips-elf/compact-eh2.s: Likewise.
* testsuite/ld-mips-elf/compact-eh3.s: Likewise.
* testsuite/ld-mips-elf/compact-eh3a.s: Likewise.
* testsuite/ld-mips-elf/eh-frame5.s: Likewise.
* testsuite/ld-mips-elf/ehdr_start-new.s: Likewise.
* testsuite/ld-mips-elf/ehdr_start-o32.s: Likewise.
* testsuite/ld-mips-elf/emit-relocs-1a.s: Likewise.
* testsuite/ld-mips-elf/jaloverflow-2.s: Likewise.
* testsuite/ld-mips-elf/jaloverflow.s: Likewise.
* testsuite/ld-mips-elf/mips16-call-global-1.s: Likewise.
* testsuite/ld-mips-elf/mips16-intermix-1.s: Likewise.
* testsuite/ld-mips-elf/mips16-pic-1b.s: Likewise.
* testsuite/ld-mips-elf/mips16-pic-4c.s: Likewise.
* testsuite/ld-mips-elf/no-shared-1-n64.s: Likewise.
* testsuite/ld-mips-elf/no-shared-1-o32.s: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-1b-micromips.s: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-1b.s: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-2a.s: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-3b.s: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-4b.s: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-5a.s: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-6-n32c.s: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-6-n64c.s: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-6-o32c.s: Likewise.
* testsuite/ld-mips-elf/pie.s: Likewise.
* testsuite/ld-mips-elf/relax-jalr.s: Likewise.
* testsuite/ld-mips-elf/reloc-1a.s: Likewise.
* testsuite/ld-mips-elf/reloc-2a.s: Likewise.
* testsuite/ld-mips-elf/reloc-4.s: Likewise.
* testsuite/ld-mips-elf/reloc-5.s: Likewise.
* testsuite/ld-mips-elf/reloc-6b.s: Likewise.
* testsuite/ld-mips-elf/textrel-1.s: Likewise.
* testsuite/ld-mips-elf/undefweak-overflow.s: Likewise.
* testsuite/ld-mips-elf/undefweak-overflow.d: Adjust.

260bcd0 2019-12-17 19:12:47 Alan Modra

Accept mips-sgi-irix output in a few ld tests

mips-sgi-irix gas emits STT_OBJECT symbols where other assemblers
would use STT_NOTYPE. See mips_frob_symbol in gas/config/tc-mips.c.
Also, the section of some dynamic symbols is set to SHN_MIPS_TEXT or
SHN_MIPS_DATA. See _bfd_mips_elf_finish_dynamic_symbol in
bfd/elfxx-mips.c. These differences are visible in readelf output
and cause some tests to fail for no other good reason.

The patch fixes the following fails and removes an xfail.
FAIL: ld-elf/pr23591
FAIL: PROVIDE_HIDDEN test (auxiliary shared object)
FAIL: PR ld/21233 dynamic symbols with section GC (auxiliary shared library)

* testsuite/ld-elf/pr21233-l.sd: Accept OBJECT for type and
PRC for section of symbols.
* testsuite/ld-elf/pr23591.d: Likewise.
* testsuite/ld-elf/provide-hidden-s.nd: Likewise.
* testsuite/ld-mips-elf/start.s: Make symbols function type.
* testsuite/ld-mips-elf/hash2.d: Adjust. Don't xfail irix.

5b66008 2019-12-17 15:06:54 Alan Modra

Remove tic80 support

This is one way of fixing ubsan bug reports, just delete the code.

The assembler support was removed back in 2005 along with other
non-BFD assemblers, but somehow the remainder of the port stayed in.

bfd/
* coff-tic80.c: Delete file.
* cpu-tic80.c: Delete file.
* archures.c: Remove tic80 support.
* coffcode.h: Likewise.
* coffswap.h: Likewise.
* targets.c: Likewise.
* config.bfd: Likewise.
* configure.ac: Likewise.
* Makefile.am: Likewise.
* Makefile.in: Regenerate.
* bfd-in2.h: Regenerate.
* configure: Regenerate.
* po/SRC-POTFILES.in: Regenerate.
binutils/
* testsuite/binutils-all/objcopy.exp: Remove tic80 support.
* testsuite/binutils-all/objdump.exp: Likewise.
gas/
* doc/as.texi: Remove mention of tic80.
include/
* coff/tic80.h: Delete file.
* opcode/tic80.h: Delete file.
ld/
* emulparams/tic80coff.sh: Delete file.
* scripttempl/tic80coff.sc: Delete file.
* configure.tgt: Remove tic80 support.
* Makefile.am: Likewise.
* Makefile.in: Regenerate.
* po/BLD-POTFILES.in: Regenerate.
opcodes/
* tic80-dis.c: Delete file.
* tic80-opc.c: Delete file.
* disassemble.c: Remove tic80 support.
* disassemble.h: Likewise.
* Makefile.am: Likewise.
* configure.ac: Likewise.
* Makefile.in: Regenerate.
* configure: Regenerate.
* po/POTFILES.in: Regenerate.

62e6599 2019-12-17 13:02:23 Alan Modra

ubsan: bpf: left shift cannot be represented in type 'DI' (aka 'long')

cpu/
* bpf.cpu (f-imm64): Avoid signed overflow.
opcodes/
* bpf-ibld.c: Regenerate.

45d7352 2019-12-17 11:03:13 Bernd Edlinger

Add a test case for skip with inlined functions

4a4c04f 2019-12-17 11:02:22 Bernd Edlinger

Check all inline frames if they are marked for skip

This makes the skip command work in optimized builds, where skipped
functions may be inlined. Previously that was only working when
stepping into a non-inlined function.

43a599b 2019-12-17 09:00:26 GDB Administrator

Automatic date update in version.in

0394eed 2019-12-17 06:30:50 Simon Marchi

jit: make gdb_symtab::blocks an std::forward_list

This patch changes the gdb_symtab::blocks manually maintained linked
list to be an std::forward_list, simplifying memory management.

Currently, the list is sorted as blocks are created. With an
std::forward_list, it is easier (and probably a bit more efficient) to
sort them once at the end, so this is what I did.

A note about the comment on the "next" field:

/* gdb_blocks are linked into a tree structure. Next points to the
next node at the same depth as this block and parent to the
parent gdb_block. */

I don't think it's true that "next" points to the next node at the same
depth. All nodes are in a simple singly linked list, so necessarily
some node will point to some other node that isn't at the same depth.

gdb/ChangeLog:

* jit.c (struct gdb_block) <next>: Remove field.
(struct gdb_symtab) <~gdb_symtab>: Remove.
<blocks>: Change type to std::forward_list<gdb_block>.
(compare_block): Remove.
(jit_block_open_impl): Adjust to std::forward_list. Place the new
block at the beginning, don't mind about sorting.
(finalize_symtab): Adjust to std::forward_list, sort the blocks list
before using it.

b611211 2019-12-17 06:30:50 Simon Marchi

jit: c++-ify gdb_block

Add a constructor to gdb_block, change the name field to be a
gdb::unique_xmalloc_ptr. This is in preparation for using an
std::forward_list<gdb_block> in the next patch.

gdb/ChangeLog:

* jit.c (struct gdb_block): Add constructor, initialize
real_block and next fields.
<name>: Change type to gdb::unique_xmalloc_ptr.
(struct gdb_symtab) <~gdb_symtab>: Free blocks with delete.
(jit_block_open_impl): Allocate gdb_block with new.
(finalize_symtab): Adjust to gdb::unique_xmalloc_ptr.

1b61f46 2019-12-17 06:30:49 Simon Marchi

jit: make gdb_object::symtabs an std::forward_list

Replace the manual linked list with an std::forward_list, simplifying
the memory management. This requires allocating gdb_object with new and
free'ing it with delete.

gdb/ChangeLog:

* jit.c: Include forward_list.
(struct gdb_symtab) <next>: Remove field.
(struct gdb_object) <symtabs>: Change type to
std::forward_list<gdb_symtab>.
(jit_object_open_impl): Allocate gdb_object with new.
(jit_symtab_open_impl): Adjust to std::forward_list.
(finalize_symtab): Don't delete symtab.
(jit_object_close_impl): Adjust to std::forward_list. Free
gdb_object with delete.

8986718 2019-12-17 06:30:49 Simon Marchi

jit: c++-ify gdb_symtab

This patch makes the gdb_symtab bit more c++y, in preparation for the
next patch that will use an std::forward_list<gdb_symtab>. It changes
the fields to use automatic memory management, in the form of
std::string and gdb::unique_xmalloc_ptr, and adds a constructor and a
destructor.

gdb/ChangeLog:

* jit.c (struct gdb_symtab): Add constructor, destructor,
initialize fields.
<linetable>: Change type to unique_xmalloc_ptr.
<file_name>: Change type to std::string.
(jit_symtab_open_impl): Allocate gdb_symtab with new.
(jit_symtab_line_mapping_add_impl): Adjust.
(finalize_symtab): Adjust, call delete on stab.

d043f8c 2019-12-17 06:30:49 Simon Marchi

Fix double-free when creating more than one block in JIT debug info reader

A double-free happens when using a JIT debug info reader that creates
more than one block. In the loop that frees blocks in finalize_symtab,
at the very end, the gdb_block_iter_tmp variable is set initially, but
not changed as the loop advances. If we have two blocks, the first
iteration frees the first block, the second iteration frees the second
block, but the third iteration tries to free the second block again, as
gdb_block_iter_tmp keeps pointing on the second block.

Fix it by assigning the gdb_block_iter_tmp variable in the loop.

I have improved the jit-reader.exp test to cover this case, by adding a
second "JIT-ed" function and creating a block for it. I have renamed
the existing function to something I find a bit more descriptive. There
are no significant changes to jit-reader.exp itself, only updates
following the renaming. The important changes are in jithost.c
(generate a new function) and in jitreader.c (create a gdb_block for
that function).

This was found because of an ASan report:

$ ./gdb testsuite/outputs/gdb.base/jit-reader/jit-reader -ex "jit-reader-load /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/jit-reader/jitreader.so" -ex r
Reading symbols from testsuite/outputs/gdb.base/jit-reader/jit-reader...
Starting program: /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/jit-reader/jit-reader
=================================================================
==1751048==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000042eb8 at pc 0x5650ef8eec88 bp 0x7ffe52767290 sp 0x7ffe52767280
READ of size 8 at 0x604000042eb8 thread T0
#0 0x5650ef8eec87 in finalize_symtab /home/simark/src/binutils-gdb/gdb/jit.c:768
#1 0x5650ef8eef88 in jit_object_close_impl /home/simark/src/binutils-gdb/gdb/jit.c:797
#2 0x7fbbda986278 in read_debug_info /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jitreader.c:71
#3 0x5650ef8ef56b in jit_reader_try_read_symtab /home/simark/src/binutils-gdb/gdb/jit.c:850
#4 0x5650ef8effe3 in jit_register_code /home/simark/src/binutils-gdb/gdb/jit.c:948
#5 0x5650ef8f2c92 in jit_event_handler(gdbarch*) /home/simark/src/binutils-gdb/gdb/jit.c:1396
#6 0x5650ef0d137e in handle_jit_event /home/simark/src/binutils-gdb/gdb/breakpoint.c:5470
[snip]

0x604000042eb8 is located 40 bytes inside of 48-byte region [0x604000042e90,0x604000042ec0)
freed by thread T0 here:
#0 0x7fbbe57376b0 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:122
#1 0x5650ef8f350b in xfree<gdb_block> /home/simark/src/binutils-gdb/gdb/gdbsupport/common-utils.h:62
#2 0x5650ef8eeca9 in finalize_symtab /home/simark/src/binutils-gdb/gdb/jit.c:769
#3 0x5650ef8eef88 in jit_object_close_impl /home/simark/src/binutils-gdb/gdb/jit.c:797
#4 0x7fbbda986278 in read_debug_info /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jitreader.c:71
#5 0x5650ef8ef56b in jit_reader_try_read_symtab /home/simark/src/binutils-gdb/gdb/jit.c:850
#6 0x5650ef8effe3 in jit_register_code /home/simark/src/binutils-gdb/gdb/jit.c:948
#7 0x5650ef8f2c92 in jit_event_handler(gdbarch*) /home/simark/src/binutils-gdb/gdb/jit.c:1396
#8 0x5650ef0d137e in handle_jit_event /home/simark/src/binutils-gdb/gdb/breakpoint.c:5470
[snip]

previously allocated by thread T0 here:
#0 0x7fbbe5737cd8 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:153
#1 0x5650eef662f3 in xcalloc /home/simark/src/binutils-gdb/gdb/alloc.c:100
#2 0x5650ef8f34ea in xcnew<gdb_block> /home/simark/src/binutils-gdb/gdb/gdbsupport/poison.h:122
#3 0x5650ef8ed467 in jit_block_open_impl /home/simark/src/binutils-gdb/gdb/jit.c:557
#4 0x7fbbda98620a in read_debug_info /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jitreader.c:60
#5 0x5650ef8ef56b in jit_reader_try_read_symtab /home/simark/src/binutils-gdb/gdb/jit.c:850
#6 0x5650ef8effe3 in jit_register_code /home/simark/src/binutils-gdb/gdb/jit.c:948
#7 0x5650ef8f2c92 in jit_event_handler(gdbarch*) /home/simark/src/binutils-gdb/gdb/jit.c:1396
#8 0x5650ef0d137e in handle_jit_event /home/simark/src/binutils-gdb/gdb/breakpoint.c:5470
[snip]

gdb/ChangeLog:

* jit.c (finalize_symtab): Set gdb_block_iter_tmp in loop.

gdb/testsuite/ChangeLog:

* gdb.base/jit-reader.exp (jit_reader_test): Rename
jit_function_00 to jit_function_stack_mangle.
* gdb.base/jithost.c (jit_function_t): Rename to...
(jit_function_stack_mangle_t): ... this.
(jit_function_add_t): New typedef.
(jit_function_00_code): Rename to...
(jit_function_stack_mangle_code): ... this, make static.
(jit_function_add_code): New.
(main): Generate "add" function and call it. Adjust to changes
in jithost_abi.
* gdb.base/jithost.h (struct jithost_abi_bounds): New.
(struct jithost_abi) <begin, end>: Remove fields.
<object, function_stack_mangle, function_add>: New fields.
* gdb.base/jitreader.c (struct reader_state) <code_begin,
code_end>: Remove fields.
<func_stack_mangle>: New field.
(read_debug_info): Adjust to renaming, create block for "add"
function.
(read_sp, unwind_frame, get_frame_id): Adjust to other changes.

d9fa87f 2019-12-17 06:08:11 Tom Tromey

Constify get_exec_file

I noticed that get_exec_file could return a "const char *". This
patch implements this change.

I couldn't build all the code -- but I did build Linux native and a
mingw cross.

Consequently, the NTO code has a hack, where it casts away const. I
think this can be removed, but that required more work there, and
since I couldn't compile it, I felt it best not to try.

Let me know what you think.

gdb/ChangeLog
2019-12-16 Tom Tromey <tromey@adacore.com>

* windows-nat.c (windows_nat_target::attach): Update.
* remote.c (extended_remote_target::attach): Update.
* procfs.c (procfs_target::attach): Update.
* nto-procfs.c (nto_procfs_target::attach): Update.
(nto_procfs_target::create_inferior): Update.
* inf-ptrace.c (inf_ptrace_target::attach): Update.
* gnu-nat.c (gnu_nat_target::attach): Update.
(gnu_nat_target::detach): Update.
* darwin-nat.c (darwin_nat_target::attach): Update.
* corefile.c (get_exec_file): Constify result. Remove extraneous
return.
* bsd-kvm.c (bsd_kvm_target_open): Update.
* gdbsupport/common-inferior.h (get_exec_file): Constify result.

gdb/gdbserver/ChangeLog
2019-12-16 Tom Tromey <tromey@adacore.com>

* server.c (get_exec_file): Constify result.

Change-Id: I29c60f7313a7def0dcb290ff0c2a4c1dea4f981f

c0c3707 2019-12-17 03:20:50 Christian Biesinger

Update Gnulib to the latest git version

This patch allows us to remove a workaround in common-defs.h due to
the gnulib fix in:
https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00024.html

All of GDB's local Gnulib patches were already fixed upstream per their
descriptions, so this patch removes them all.

The problem listed here:
https://sourceware.org/ml/gdb-patches/2019-08/msg00553.html
was probably partially fixed by moving gnulib to the toplevel;
for the remainder, I am setting MAKEOVERRIDES to empty in
gnulib/Makefile.am. See also the comment there (it fixes an issue
with compilers that don't use C99/C11 by default such as GCC 4.8.5,
the default on Centos 7).

gdb/ChangeLog:

2019-12-16 Christian Biesinger <cbiesinger@google.com>

* gdbsupport/common-defs.h: Remove workaround for a gnulib bug
(we no longer need to include time.h before pathmax.h)

gnulib/ChangeLog:

2019-12-16 Christian Biesinger <cbiesinger@google.com>

* Makefile.am: Set MAKEOVERRIDES.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
* import/Makefile.am: Update.
* import/Makefile.in: Regenerate.
* import/_Noreturn.h: New file.
* import/alloca.c (i00afunc): Update.
* import/alloca.in.h (if): Update.
* import/arg-nonnull.h: Rename from import/extra/snippet/arg-nonnull.h.
* import/arpa_inet.in.h (if): Update.
* import/assure.h: Update.
* import/at-func.c: Update.
* import/basename-lgpl.c: Update.
* import/canonicalize-lgpl.c (if): Update.
* import/c++defs.h: Rename from import/extra/snippet/c++defs.h.
* import/cdefs.h: New file.
* import/chdir-long.c: Update.
* import/chdir-long.h: Update.
* import/cloexec.c: Update.
* import/cloexec.h: Update.
* import/close.c: Update.
* import/closedir.c: Update.
* import/config.charset: Remove.
* import/dirent-private.h: Update.
* import/dirent.in.h: Update.
* import/dirfd.c: Update.
* import/dirname-lgpl.c: Update.
* import/dirname.h (base_name): Update.
* import/dosname.h (if): Update.
* import/dup-safer-flag.c: New file.
* import/dup-safer.c: Update.
* import/dup.c: Update.
* import/dup2.c (if): Update.
(dup2_nothrow): Update.
(ms_windows_dup2): Update.
* import/errno.in.h (if): Update.
(elif): Update.
* import/error.c (if): Update.
(strerror_r): Update.
(program_name): Update.
(error): Update.
(error_at_line): Update.
* import/error.h: Update.
* import/exitfail.c: Update.
* import/exitfail.h: Update.
* import/extra/config.rpath: Update.
* import/extra/snippet/_Noreturn.h: Remove.
* import/extra/update-copyright: Update.
* import/fchdir.c: Update.
* import/fcntl.c (rpl_fcntl): Update.
(INCL_DOS): Update.
(if): Update.
(rpl_fcntl_DUPFD): Update.
(rpl_fcntl_DUPFD_CLOEXEC): Update.
(klibc_fcntl): Update.
(fcntl): Update.
(have_dupfd_cloexec): Update.
* import/fcntl.in.h (if): Update.
(creat): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
(O_CLOEXEC): Update.
(GNULIB_defined_O_CLOEXEC): Update.
* import/fd-hook.c: Update.
* import/fd-hook.h: Update.
* import/fd-safer-flag.c: New file.
* import/fd-safer.c: Update.
* import/fdopendir.c: Update.
* import/filename.h: Update.
* import/filenamecat-lgpl.c (longest_relative_suffix): Update.
(mfile_name_concat): Update.
* import/filenamecat.h: Update.
* import/flexmember.h: Update.
* import/float+.h: Update.
* import/float.c: Update.
* import/float.in.h (LDBL_MIN): Update.
* import/fnmatch.c (__builtin_expect): Update.
(FALLTHROUGH): Update.
* import/fnmatch.in.h (_FNMATCH_H): Update.
(_): Update.
(fnmatch): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
* import/fnmatch_loop.c (FCT): Update.
(EXT): Update.
* import/fpucw.h (GET_FPUCW): Update.
(SET_FPUCW): Update.
* import/frexp.c: Update.
* import/frexpl.c: Update.
* import/fstat.c (stat): Update.
(fstat): Update.
(WINDOWS_NATIVE): Update.
(fstat_nothrow): Update.
(WIN32_LEAN_AND_MEAN): Update.
* import/fstatat.c (normal_fstatat): Update.
(rpl_fstatat): Update.
* import/getcwd-lgpl.c (rpl_getcwd): Update.
* import/getcwd.c (getcwd_nothrow): Update.
(getcwd_system): Update.
(__getcwd): Update.
* import/getdtablesize.c (if): Update.
(_setmaxstdio): Update.
(_setmaxstdio_nothrow): Update.
(getdtablesize): Update.
* import/getlogin_r.c (if): Update.
(getlogin_r): Update.
* import/getprogname.c (getprogname): Update.
* import/getprogname.h: Update.
* import/gettext.h (if): Update.
* import/gettimeofday.c (WINDOWS_NATIVE): Update.
(localtime): Update.
(GetProcAddress): Update.
(gmtime): Update.
(void): Update.
(struct tm): Update.
(rpl_localtime): Update.
(initialize): Update.
(rpl_gmtime): Update.
(tzset): Update.
(rpl_tzset): Update.
* import/glob-libc.h (_Restrict_): Update.
(__size_t): Update.
(__need_size_t): Update.
(glob): Update.
(globfree): Update.
(__REDIRECT_NTH): Update.
(glob64): Update.
(globfree64): Update.
(glob_pattern_p): Update.
* import/glob.c (POSIX): Update.
(if): Update.
(__set_errno): Update.
(getpwnam_r): Update.
(__lstat64): Update.
(FLEXIBLE_ARRAY_MEMBER): Update.
(__glob_pattern_p): Update.
(GETPW_R_SIZE_MAX): Update.
(GET_LOGIN_NAME_MAX): Update.
(DT_UNKNOWN): Update.
(DT_DIR): Update.
(DT_LNK): Update.
(D_TYPE_TO_RESULT): Update.
(readdir_result_might_be_symlink): Update.
(readdir_result_might_be_dir): Update.
(readdir_result_type): Update.
(D_INO_TO_RESULT): Update.
(READDIR_RESULT_INITIALIZER): Update.
(attribute_hidden): Update.
(__attribute_noinline__): Update.
(__builtin_expect): Update.
(__glibc_unlikely): Update.
(__has_builtin): Update.
(__glob_pattern_type): Update.
(is_dir): Update.
(glob): Update.
(globfree): Update.
(libc_hidden_def): Update.
(DIRSEP_CHAR): Update.
(prefix_array): Update.
(weak_alias): Update.
(link_exists2_p): Update.
(link_exists_p): Update.
(glob_in_dir): Update.
(GLOBNAMES_MEMBERS): Update.
* import/glob.in.h (_GL_GLOB_H): Update.
(_): Update.
(__BEGIN_DECLS): Update.
(__END_DECLS): Update.
(_Restrict_): Update.
(__THROW): Update.
(__THROWNL): Update.
(__size_t): Update.
(__USE_GNU): Update.
(glob): Update.
(globfree): Update.
(glob_pattern_p): Update.
(__glob_pattern_p): Update.
(__GLOB_GNULIB): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_WARN_ON_USE): Update.
* import/glob_internal.h: New file.
* import/glob_pattern_p.c: New file.
* import/globfree.c: New file.
* import/glthread/lock.c (glthread_rwlock_init_for_glibc): Update.
(glthread_rwlock_rdlock_multithreaded): Update.
(glthread_once_call): Update.
(glthread_once_multithreaded): Update.
(glthread_once_singlethreaded): Update.
(glthread_recursive_lock_init_multithreaded): Update.
(glthread_recursive_lock_lock_multithreaded): Update.
(glthread_recursive_lock_unlock_multithreaded): Update.
(glthread_recursive_lock_destroy_multithreaded): Update.
(glthread_lock_init_func): Update.
(glthread_lock_lock_func): Update.
(glthread_lock_unlock_func): Update.
(glthread_lock_destroy_func): Update.
(gl_waitqueue_t): Update.
(gl_waitqueue_init): Update.
(gl_waitqueue_add): Update.
(gl_waitqueue_notify_first): Update.
(gl_waitqueue_notify_all): Update.
(glthread_rwlock_init_func): Update.
(glthread_rwlock_rdlock_func): Update.
(glthread_rwlock_wrlock_func): Update.
(glthread_rwlock_unlock_func): Update.
(glthread_rwlock_destroy_func): Update.
(glthread_recursive_lock_init_func): Update.
(glthread_recursive_lock_lock_func): Update.
(glthread_recursive_lock_unlock_func): Update.
(glthread_recursive_lock_destroy_func): Update.
(glthread_once_func): Update.
* import/glthread/lock.h (c11_threads_in_use): Update.
(pthread_in_use): Update.
(gl_rwlock_initializer): Update.
(glthread_rwlock_init): Update.
(glthread_rwlock_init_for_glibc): Update.
(pth_in_use): Update.
(gl_lock_define): Update.
(gl_lock_define_initialized): Update.
(gl_lock_initializer): Update.
(glthread_lock_init): Update.
(glthread_lock_lock): Update.
(glthread_lock_unlock): Update.
(glthread_lock_destroy): Update.
(gl_rwlock_define): Update.
(gl_rwlock_define_initialized): Update.
(glthread_rwlock_rdlock): Update.
(glthread_rwlock_wrlock): Update.
(glthread_rwlock_unlock): Update.
(glthread_rwlock_destroy): Update.
(gl_recursive_lock_define): Update.
(gl_recursive_lock_define_initialized): Update.
(gl_recursive_lock_initializer): Update.
(glthread_recursive_lock_init): Update.
(glthread_recursive_lock_lock): Update.
(glthread_recursive_lock_unlock): Update.
(glthread_recursive_lock_destroy): Update.
(gl_once_define): Update.
(glthread_once): Update.
(glthread_once_multithreaded): Update.
(glthread_once_singlethreaded): Update.
(thread_in_use): Update.
(glthread_recursive_lock_init_multithreaded): Update.
(glthread_recursive_lock_lock_multithreaded): Update.
(glthread_recursive_lock_unlock_multithreaded): Update.
(glthread_recursive_lock_destroy_multithreaded): Update.
(glthread_lock_init_func): Update.
(glthread_lock_lock_func): Update.
(glthread_lock_unlock_func): Update.
(glthread_lock_destroy_func): Update.
(glthread_rwlock_init_func): Update.
(glthread_rwlock_rdlock_func): Update.
(glthread_rwlock_wrlock_func): Update.
(glthread_rwlock_unlock_func): Update.
(glthread_rwlock_destroy_func): Update.
(glthread_recursive_lock_init_func): Update.
(glthread_recursive_lock_lock_func): Update.
(glthread_recursive_lock_unlock_func): Update.
(glthread_recursive_lock_destroy_func): Update.
(glthread_once_func): Update.
* import/glthread/threadlib.c: Update.
* import/hard-locale.c: Update.
* import/hard-locale.h: Update.
* import/inet_ntop.c: Update.
* import/intprops.h (__has_builtin): Update.
(_GL_INT_CONVERT): Update.
(_GL_INT_NEGATE_CONVERT): Update.
(verify): Update.
(_GL_HAS_BUILTIN_OVERFLOW): Update.
(_GL_HAS_BUILTIN_ADD_OVERFLOW): Update.
(_GL_HAS_BUILTIN_OVERFLOW_P): Update.
(_GL_HAS_BUILTIN_MUL_OVERFLOW): Update.
(_GL_BINARY_OP_OVERFLOW): Update.
(INT_ADD_WRAPV): Update.
(INT_SUBTRACT_WRAPV): Update.
(INT_MULTIPLY_WRAPV): Update.
(_GL_INT_OP_WRAPV): Update.
(_GL_INT_OP_WRAPV_SMALLISH): Update.
(_GL_INT_OP_WRAPV_LONGISH): Update.
(_GL_INT_OP_CALC): Update.
(_GL_INT_OP_CALC1): Update.
(_GL_INT_OP_WRAPV_VIA_UNSIGNED): Update.
(_GL_INT_ADD_RANGE_OVERFLOW): Update.
(_GL_INT_SUBTRACT_RANGE_OVERFLOW): Update.
(_GL_INT_MULTIPLY_RANGE_OVERFLOW): Update.
* import/inttypes.in.h (if): Update.
* import/isnan.c: Update.
* import/isnand-nolibm.h: Update.
* import/isnand.c: Update.
* import/isnanl-nolibm.h: Update.
* import/isnanl.c: Update.
* import/itold.c: Update.
* import/libc-config.h: New file.
* import/limits.in.h (LLONG_MIN): Update.
(LLONG_MAX): Update.
(ULLONG_MAX): Update.
(WORD_BIT): Update.
(LONG_BIT): Update.
* import/localcharset.c (setlocale): Update.
(relocate): Update.
(O_NOFOLLOW): Update.
(ISSLASH): Update.
(DIRECTORY_SEPARATOR): Update.
(getc): Update.
(volatile): Update.
(get_charset_aliases): Update.
(struct table_entry): Update.
(alias_table_defined): Update.
(locale_table_defined): Update.
(locale_charset): Update.
(if): Update.
* import/localcharset.h: Update.
* import/localtime-buffer.c: New file.
* import/localtime-buffer.h: New file.
* import/lstat.c (rpl_lstat): Update.
* import/m4/00gnulib.m4: Update.
* import/m4/__inline.m4: New file.
* import/m4/absolute-header.m4: Update.
* import/m4/alloca.m4: Update.
* import/m4/arpa_inet_h.m4: Update.
* import/m4/builtin-expect.m4: New file.
* import/m4/canonicalize.m4: Update.
* import/m4/chdir-long.m4: Update.
* import/m4/close.m4: Update.
* import/m4/closedir.m4: Update.
* import/m4/codeset.m4: Update.
* import/m4/configmake.m4: Remove.
* import/m4/d-ino.m4: Update.
* import/m4/d-type.m4: Update.
* import/m4/dirent_h.m4: Update.
* import/m4/dirfd.m4: Update.
* import/m4/dirname.m4: Update.
* import/m4/double-slash-root.m4: Update.
* import/m4/dup.m4: Update.
* import/m4/dup2.m4: Update.
* import/m4/eealloc.m4: Update.
* import/m4/environ.m4: Update.
* import/m4/errno_h.m4: Update.
* import/m4/error.m4: Update.
* import/m4/exponentd.m4: Update.
* import/m4/exponentl.m4: Update.
* import/m4/extensions.m4: Update.
* import/m4/extern-inline.m4: Update.
* import/m4/fchdir.m4: Update.
* import/m4/fcntl-o.m4: Update.
* import/m4/fcntl.m4: Update.
* import/m4/fcntl_h.m4: Update.
* import/m4/fdopendir.m4: Update.
* import/m4/filenamecat.m4: Update.
* import/m4/flexmember.m4: Update.
* import/m4/float_h.m4: Update.
* import/m4/fnmatch.m4: Update.
* import/m4/fnmatch_h.m4: New file.
* import/m4/fpieee.m4: Update.
* import/m4/frexp.m4: Update.
* import/m4/frexpl.m4: Update.
* import/m4/fstat.m4: Update.
* import/m4/fstatat.m4: Update.
* import/m4/getcwd-abort-bug.m4: Update.
* import/m4/getcwd-path-max.m4: Update.
* import/m4/getcwd.m4: Update.
* import/m4/getdtablesize.m4: Update.
* import/m4/getlogin.m4: New file.
* import/m4/getlogin_r.m4: Update.
* import/m4/getpagesize.m4: New file.
* import/m4/getprogname.m4: Update.
* import/m4/gettimeofday.m4: Update.
* import/m4/glibc21.m4: Remove.
* import/m4/glob.m4: Update.
* import/m4/glob_h.m4: New file.
* import/m4/gnulib-cache.m4: Update.
* import/m4/gnulib-common.m4: Update.
* import/m4/gnulib-comp.m4: Update.
* import/m4/gnulib-tool.m4: Update.
* import/m4/hard-locale.m4: Remove.
* import/m4/host-cpu-c-abi.m4: New file.
* import/m4/include_next.m4: Update.
* import/m4/inet_ntop.m4: Update.
* import/m4/inttypes-pri.m4: Update.
* import/m4/inttypes.m4: Update.
* import/m4/isnand.m4: Update.
* import/m4/isnanl.m4: Update.
* import/m4/largefile.m4: Update.
* import/m4/lib-ld.m4: Update.
* import/m4/lib-link.m4: Update.
* import/m4/lib-prefix.m4: Update.
* import/m4/limits-h.m4: Update.
* import/m4/localcharset.m4: Update.
* import/m4/locale-fr.m4: Update.
* import/m4/locale-ja.m4: Update.
* import/m4/locale-zh.m4: Update.
* import/m4/localtime-buffer.m4: New file.
* import/m4/lock.m4: Update.
* import/m4/longlong.m4: Update.
* import/m4/lstat.m4: Update.
* import/m4/malloc.m4: Update.
* import/m4/malloca.m4: Update.
* import/m4/math_h.m4: Update.
* import/m4/mbrtowc.m4: Update.
* import/m4/mbsinit.m4: Update.
* import/m4/mbsrtowcs.m4: Update.
* import/m4/mbstate_t.m4: Update.
* import/m4/memchr.m4: Update.
* import/m4/memmem.m4: Update.
* import/m4/mempcpy.m4: Update.
* import/m4/memrchr.m4: Update.
* import/m4/mkdir.m4: Update.
* import/m4/mkdtemp.m4: Update.
* import/m4/mkostemp.m4: Update.
* import/m4/mmap-anon.m4: Update.
* import/m4/mode_t.m4: Update.
* import/m4/msvc-inval.m4: Update.
* import/m4/msvc-nothrow.m4: Update.
* import/m4/multiarch.m4: Update.
* import/m4/netinet_in_h.m4: Update.
* import/m4/nocrash.m4: Update.
* import/m4/off_t.m4: Update.
* import/m4/onceonly.m4: Remove.
* import/m4/open-cloexec.m4: New file.
* import/m4/open-slash.m4: New file.
* import/m4/open.m4: Update.
* import/m4/openat.m4: Update.
* import/m4/opendir.m4: Update.
* import/m4/pathmax.m4: Update.
* import/m4/pthread_rwlock_rdlock.m4: New file.
* import/m4/rawmemchr.m4: Update.
* import/m4/readdir.m4: Update.
* import/m4/readlink.m4: Update.
* import/m4/realloc.m4: Update.
* import/m4/rename.m4: Update.
* import/m4/rewinddir.m4: Update.
* import/m4/rmdir.m4: Update.
* import/m4/save-cwd.m4: Update.
* import/m4/secure_getenv.m4: Remove.
* import/m4/setenv.m4: Update.
* import/m4/signal_h.m4: Update.
* import/m4/socklen.m4: Update.
* import/m4/sockpfaf.m4: Update.
* import/m4/ssize_t.m4: Update.
* import/m4/stat-time.m4: New file.
* import/m4/stat.m4: Update.
* import/m4/std-gnu11.m4: New file.
* import/m4/stdalign.m4: Update.
* import/m4/stdbool.m4: Update.
* import/m4/stddef_h.m4: Update.
* import/m4/stdint.m4: Update.
* import/m4/stdio_h.m4: Update.
* import/m4/stdlib_h.m4: Update.
* import/m4/strchrnul.m4: Update.
* import/m4/strdup.m4: Update.
* import/m4/strerror.m4: Update.
* import/m4/strerror_r.m4: Update.
* import/m4/string_h.m4: Update.
* import/m4/strstr.m4: Update.
* import/m4/strtok_r.m4: Update.
* import/m4/sys_socket_h.m4: Update.
* import/m4/sys_stat_h.m4: Update.
* import/m4/sys_time_h.m4: Update.
* import/m4/sys_types_h.m4: Update.
* import/m4/sys_uio_h.m4: Update.
* import/m4/tempname.m4: Update.
* import/m4/threadlib.m4: Update.
* import/m4/time_h.m4: Update.
* import/m4/time_r.m4: Update.
* import/m4/unistd-safer.m4: Update.
* import/m4/unistd_h.m4: Update.
* import/m4/warn-on-use.m4: Update.
* import/m4/wchar_h.m4: Update.
* import/m4/wchar_t.m4: Update.
* import/m4/wctype_h.m4: Update.
* import/m4/wint_t.m4: Update.
* import/malloc.c: Update.
* import/malloc/scratch_buffer.h: New file.
* import/malloc/scratch_buffer_grow.c: New file.
* import/malloc/scratch_buffer_grow_preserve.c: New file.
* import/malloc/scratch_buffer_set_array_size.c: New file.
* import/malloca.c (MAGIC_NUMBER): Update.
(MAGIC_SIZE): Update.
(struct preliminary_header): Update.
(HEADER_SIZE): Update.
(union header): Update.
(verify): Update.
(HASH_TABLE_SIZE): Update.
(freea): Update.
* import/malloca.h (malloca): Update.
(nmalloca): Update.
* import/malloca.valgrind: Remove.
* import/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Update.
(func): Update.
(rpl_func): Update.
(f): Update.
(d): Update.
(l): Update.
(_GL_WARN_ON_USE): Update.
(_GL_WARN_ON_USE_ATTRIBUTE): Update.
(FP_ILOGB0): Update.
(FP_ILOGBNAN): Update.
(acosf): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(asinf): Update.
(atanf): Update.
(atan2f): Update.
(cosf): Update.
(coshf): Update.
(expf): Update.
(expl): Update.
(expm1l): Update.
(ilogbl): Update.
(rintl): Update.
(sinf): Update.
(sinhf): Update.
(sqrtf): Update.
(tanf): Update.
(tanhf): Update.
(isfinite): Update.
(isinf): Update.
(isnan): Update.
(GNULIB_defined_signbit): Update.
(signbit): Update.
* import/mbrtowc.c (FALLTHROUGH): Update.
(locale_enc): Update.
(locale_enc_cached): Update.
(gl_lock_define_initialized): Update.
(mbrtowc): Update.
* import/mbsinit.c (if): Update.
(mbsinit): Update.
* import/mbsrtowcs-impl.h: Update.
* import/mbsrtowcs-state.c: Update.
* import/mbsrtowcs.c: Update.
* import/memchr.c: Update.
* import/memchr.valgrind: Update.
* import/memmem.c (__builtin_expect): Update.
* import/mempcpy.c: Update.
* import/memrchr.c (__memrchr): Update.
* import/mkdir.c (if): Update.
* import/mkdtemp.c: Update.
* import/mkostemp.c: Update.
* import/msvc-inval.c: Update.
* import/msvc-inval.h: Update.
* import/msvc-nothrow.c: Update.
* import/msvc-nothrow.h (if): Update.
* import/netinet_in.in.h: Update.
* import/open.c (open): Update.
(if): Update.
* import/openat-die.c: Update.
* import/openat-priv.h: Update.
* import/openat-proc.c: Update.
* import/openat.c (rpl_openat): Update.
* import/openat.h: Update.
* import/opendir.c: Update.
* import/pathmax.h (if): Update.
* import/pipe-safer.c: Update.
* import/rawmemchr.c: Update.
* import/rawmemchr.valgrind: Update.
* import/readdir.c (readdir): Update.
* import/readlink.c: Update.
* import/realloc.c: Update.
* import/ref-add.sin: Remove.
* import/ref-del.sin: Remove.
* import/rename.c (if): Update.
* import/rewinddir.c: Update.
* import/rmdir.c: Update.
* import/same-inode.h (SAME_INODE): Update.
* import/save-cwd.c (save_cwd): Update.
* import/save-cwd.h: Update.
* import/scratch_buffer.h: New file.
* import/secure_getenv.c: Remove.
* import/setenv.c: Update.
* import/signal.in.h: Update.
* import/stat-time.c: New file.
* import/stat-time.h: New file.
* import/stat-w32.c: New file.
* import/stat-w32.h: New file.
* import/stat.c (if): Update.
(stat): Update.
(REPLACE_FUNC_STAT_DIR): Update.
(WINDOWS_NATIVE): Update.
(WIN32_LEAN_AND_MEAN): Update.
(is_unc_root): Update.
(rpl_stat): Update.
* import/stdalign.in.h (elif): Update.
* import/stdbool.in.h: Update.
* import/stddef.in.h (_GL_STDDEF_ALIGNAS): Update.
(max_align_t): Update.
(GNULIB_defined_max_align_t): Update.
* import/stdint.in.h (WINT_MIN): Update.
(WINT_MAX): Update.
(_STDINT_MIN): Update.
(_STDINT_UNSIGNED_MIN): Update.
(_STDINT_SIGNED_MIN): Update.
(PTRDIFF_MIN): Update.
(SIG_ATOMIC_MIN): Update.
(WCHAR_MIN): Update.
* import/stdio.in.h (if): Update.
* import/stdlib.in.h (if): Update.
(_GL_WARN_ON_USE): Update.
(_GL_FUNCDECL_SYS): Update.
(random): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(srandom): Update.
(initstate): Update.
(setstate): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(GNULIB_defined_strtod_function): Update.
(strtold): Update.
(GNULIB_defined_strtold_function): Update.
* import/str-two-way.h: Update.
* import/strchrnul.c: Update.
* import/strchrnul.valgrind: Update.
* import/strdup.c: Update.
* import/streq.h: Update.
* import/strerror-override.c: Update.
* import/strerror-override.h: Update.
* import/strerror.c (strerror): Update.
* import/strerror_r.c (safe_copy): Update.
* import/string.in.h (_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
* import/stripslash.c: Update.
* import/strnlen1.c: Update.
* import/strnlen1.h: Update.
* import/strstr.c (__builtin_expect): Update.
* import/strtok_r.c: Update.
* import/sys_socket.in.h (CMSG_SPACE): Update.
(CMSG_LEN): Update.
(struct sockaddr_storage): Update.
(SO_REUSEPORT): Update.
(_GL_WARN_ON_USE): Update.
* import/sys_stat.in.h (if): Update.
(stat): Update.
(struct stat): Update.
(st_atime): Update.
(st_mtime): Update.
(st_ctime): Update.
(_GL_WINDOWS_STAT_TIMESPEC): Update.
(GNULIB_defined_struct_stat): Update.
(_S_IFBLK): Update.
(_S_IFLNK): Update.
(_S_IFSOCK): Update.
(fstat): Update.
(fstatat): Update.
(lstat): Update.
(stat64): Update.
(_stat64): Update.
(_stat32i64): Update.
(_stati64): Update.
(_stat32): Update.
(_stat64i32): Update.
* import/sys_time.in.h: Update.
* import/sys_types.in.h (dev_t): Update.
(GNULIB_defined_dev_t): Update.
(ino_t): Update.
(GNULIB_defined_ino_t): Update.
(_GL_WINDOWS_STAT_INODES): Update.
(if): Update.
* import/sys_uio.in.h: Update.
* import/tempname.c (__secure_getenv): Update.
(try_nocreate): Update.
* import/tempname.h: Update.
* import/time.in.h (tzset): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(ctime): Update.
(strftime): Update.
* import/time_r.c: Update.
* import/unistd--.h: Update.
* import/unistd-safer.h: Update.
* import/unistd.in.h (if): Update.
(elif): Update.
(__need_getopt): Update.
(access): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
(_GL_FUNCDECL_SYS): Update.
(__declspec): Update.
(_GL_WARN_ON_USE_ATTRIBUTE): Update.
(faccessat): Update.
(getpass): Update.
(truncate): Update.
* import/unsetenv.c: Update.
* import/verify.h (if): Update.
(_GL_HAVE__STATIC_ASSERT): Update.
(_GL_HAVE_STATIC_ASSERT): Update.
(_GL_HAVE__STATIC_ASSERT1): Update.
(_GL_HAVE_STATIC_ASSERT1): Update.
(_GL_VERIFY): Update.
(_Static_assert): Update.
(_GL_HAS_BUILTIN_TRAP): Update.
(_GL_HAS_BUILTIN_UNREACHABLE): Update.
(verify_true): Update.
(verify): Update.
(__has_builtin): Update.
(elif): Update.
(assume): Update.
* import/warn-on-use.h: Rename from import/extra/snippet/warn-on-use.h.
* import/wchar.in.h (if): Update.
(wcsftime): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
* import/wctype.in.h (rpl_iswalnum): Update.
(rpl_iswalpha): Update.
(rpl_iswblank): Update.
(rpl_iswcntrl): Update.
(rpl_iswdigit): Update.
(rpl_iswgraph): Update.
(rpl_iswlower): Update.
(rpl_iswprint): Update.
(rpl_iswpunct): Update.
(rpl_iswspace): Update.
(rpl_iswupper): Update.
(rpl_iswxdigit): Update.
(rpl_towlower): Update.
(rpl_towupper): Update.
(iswalnum): Update.
(iswalpha): Update.
(iswblank): Update.
(iswcntrl): Update.
(iswdigit): Update.
(iswgraph): Update.
(iswlower): Update.
(iswprint): Update.
(iswpunct): Update.
(iswspace): Update.
(iswupper): Update.
(iswxdigit): Update.
(towlower): Update.
(towupper): Update.
* import/windows-initguard.h: New file.
* import/windows-mutex.c: New file.
* import/windows-mutex.h: New file.
* import/windows-once.c: New file.
* import/windows-once.h: New file.
* import/windows-recmutex.c: New file.
* import/windows-recmutex.h: New file.
* import/windows-rwlock.c: New file.
* import/windows-rwlock.h: New file.
* import/xalloc-oversized.h: New file.
* patches/0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch: Remove.
* patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch: Remove.
* patches/0003-Fix-glob-c-Coverity-issues.patch: Remove.
* update-gnulib.sh: Update to latest gnulib and don't apply patches
anymore. Also updates the patch -p flag to the current directory structure in
case patches are needed again in the future.

Change-Id: I9c2b07a3046baecfb664e21b2644353ea888dbfa

f81e7e2 2019-12-16 16:05:13 Alan Modra

ubsan: aarch64: left shift of negative value

* aarch64-dis.c (sign_extend): Return uint64_t. Rewrite without
conditional.
(aarch64_ext_imm): Avoid signed overflow.

488d02f 2019-12-16 16:05:13 Alan Modra

ubsan: microblaze: left shift cannot be represented in type 'int'

* microblaze-dis.c (read_insn_microblaze): Avoid signed overflow.

8a92faa 2019-12-16 16:05:13 Alan Modra

ubsan: nios2: left shift cannot be represented in type 'int'

* nios2-dis.c (nios2_print_insn_arg): Avoid signed overflow

e6ced26 2019-12-16 16:05:13 Alan Modra

ubsan: xstormy16: left shift of negative value

cpu/
* xstormy16.cpu (f-rel12a): Avoid signed overflow.
opcodes/
* xstormy16-ibld.c: Regenerate.

84e098c 2019-12-16 16:04:29 Alan Modra

asan: score: global-buffer-overflow

I'm flying blind here, not having an s+core s3 insn set reference,
but this seems reasonably obvious from what is done by the assembler.
s3_do16_rpop does some mixing of imm and reg values to place in the
rpop reg field, but I'm not going to try to fix the disassembly
there.

* score-dis.c (print_insn_score16): Move rpush/rpop imm field
value adjustment so that it doesn't affect reg field too.

36bd8ea 2019-12-16 16:03:53 Alan Modra

ubsan: crx: left shift cannot be represented in type 'int'

The ubsan complaint is fixed by the SBM change, with similar possible
complaints fixed by the EXTRACT change. The rest is just cleanup.

include/
* opcode/crx.h (inst <match>): Make unsigned int.
opcodes/
* crx-dis.c (EXTRACT, SBM): Avoid signed overflow.
(get_number_of_operands, getargtype, getbits, getregname),
(getcopregname, getprocregname, gettrapstring, getcinvstring),
(getregliststring, get_word_at_PC, get_words_at_PC, build_mask),
(powerof2, match_opcode, make_instruction, print_arguments),
(print_arg): Delete forward declarations, moving static to..
(getregname, getcopregname, getregliststring): ..these definitions.
(build_mask): Return unsigned int mask.
(match_opcode): Use unsigned int vars.

cedfc77 2019-12-16 16:03:53 Alan Modra

ubsan: bfin: left shift of negative value

* bfin-dis.c (fmtconst, fmtconst_val): Avoid signed overflow.

4bdb25f 2019-12-16 16:03:53 Alan Modra

ubsan: nds32: left shift cannot be represented in type 'int'

Note that using 1u in N32_BIT makes all of N32_BIT, __MASK, __MF, __GF
and __SEXT evaluate as unsigned int (the latter three when when their
v arg is int or smaller). This would be a problem if assigning the
result to a bfd_vma, long, or other type wider than an int since the
__SEXT result would be zero extended to the wider type. Fortunately
nds32 target code doesn't use wider types unnecessarily.

include/
* opcode/nds32.h (N32_BIT): Define using 1u.
(__SEXT): Use __MASK and N32_BIT.
(N32_IMMS): Remove duplicate mask.
opcodes/
* nds32-dis.c (print_insn16, print_insn32): Remove forward decls.
(struct objdump_disasm_info): Delete.
(nds32_parse_audio_ext, nds32_parse_opcode): Cast result of
N32_IMMS to unsigned before shifting left.