1. Sep 26, 2019
  2. May 23, 2019
    • Jim Wilson's avatar
      RISC-V: Add _LITE_EXIT in crt0.S. · 77ac27dc
      Jim Wilson authored
      This patch adds _LITE_EXIT in crt0.S to enable "lite exit" technique in
      RISC-V. The changes have been tested in riscv/riscv-gnu-toolchain by
      riscv-dejagnu with riscv-sim.exp/riscv-sim-nano.exp.
      77ac27dc
    • Jim Wilson's avatar
      RISC-V: Add size optimized memcpy, memmove, memset and strcmp. · 5c86f0da
      Jim Wilson authored
      This patch adds implementations of memcpy, memmove, memset and strcmp
      optimized for size. The changes have been tested in
      riscv/riscv-gnu-toolchain by riscv-dejagnu with
      riscv-sim.exp/riscv-sim-nano.exp.
      5c86f0da
  3. May 16, 2019
    • Faraz Shahbazker's avatar
      Make .data section placement coincide with _fdata symbol · a9a0d219
      Faraz Shahbazker authored
      The _fdata symbol in MIPS linker scripts is aligned to a 16-byte
      boundary.  The ALIGN function does not implicitly update current
      location counter.  If sections positioned after the assignment
      do not have the same natural alignment as the ALIGN function then
      the start of the section group will not coincide with the value
      of the symbol.
      
      Given the linker command sequence:
        symbol = ALIGN (NN);
        (.section*)
      where the idiom implies a desire to mark the beginning of .section
      with symbol, there must be an assignment to the location counter
      between the assignment to symbol and the .section pattern.
      
      libgloss/
      	* mips/array.ld: Update the location counter to match _fdata.
      	* mips/cfe.ld: Likewise.
      	* mips/ddb-kseg0.ld: Likewise.
      	* mips/ddb.ld: Likewise.
      	* mips/dve.ld: Likewise.
      	* mips/idt.ld: Likewise.
      	* mips/idt32.ld: Likewise.
      	* mips/idt64.ld: Likewise.
      	* mips/idtecoff.ld: Likewise.
      	* mips/jmr3904app-java.ld: Likewise.
      	* mips/jmr3904app.ld: Likewise.
      	* mips/jmr3904dram-java.ld: Likewise.
      	* mips/jmr3904dram.ld: Likewise.
      	* mips/lsi.ld: Likewise.
      	* mips/mti32.ld: Likewise.
      	* mips/mti64.ld: Likewise.
      	* mips/mti64_64.ld: Likewise.
      	* mips/mti64_n32.ld: Likewise.
      	* mips/nullmon.ld: Likewise.
      	* mips/pmon.ld: Likewise.
      	* mips/sde32.ld: Likewise.
      	* mips/sde64.ld: Likewise.
      a9a0d219
  4. May 10, 2019
    • Ken Brown's avatar
      Cygwin: FIFO: code simplifications. · e91bc190
      Ken Brown authored
      There's no longer a need to consider the connect_evt after fork/exec.
      After stopping the listen_client thread, all client handlers should be
      in the fc_connected or fc_invalid states, so their connect_evt members
      won't be used again.
      
      Also remove code in fhandler_fifo::dup that just repeats things
      already done in stop_listen_client.
      e91bc190
    • Ken Brown's avatar
      Cygwin: FIFO: make read_ready an auto-reset event · 0771fc70
      Ken Brown authored
      There's no point in allowing a writer to attempt to open until we've
      created a pipe instance.
      0771fc70
    • Ken Brown's avatar
      Cygwin: FIFO: improve the check for the listen_client thread · 102571f8
      Ken Brown authored
      Add a method fhandler_fifo::check_listen_client_thread that checks
      whether the thread is running.  Use it in raw_read instead of just
      testing the handle listen_client_thr.
      102571f8
    • Ken Brown's avatar
      Cygwin: FIFO: set client handler flags more accurately · 7ad80b3c
      Ken Brown authored
      Reflect the fact that client handlers are only used for reading and
      that, after connection, they are always nonblocking.
      7ad80b3c
    • Ken Brown's avatar
      Cygwin: FIFO: don't leave a pending listen request · c12053a7
      Ken Brown authored
      On exit from the listen_client thread, make sure there's no pending
      FSCTL_PIPE_LISTEN request.  Otherwise we might get a client connection
      after restarting the thread, and we won't have a handle for
      communicating with that client.
      
      Remove the retry loop in the case of STATUS_PIPE_LISTENING; that case
      shouldn't occur.
      
      Remove the now-unused fc_connecting value from
      fifo_client_connect_state.
      c12053a7
    • Ken Brown's avatar
      Cygwin: FIFO: add a HANDLE parameter to open_pipe · 816c6da5
      Ken Brown authored
      It's now up to the caller to pass a handle to open_pipe and, if
      desired, to call set_handle on return.
      
      This will be useful for a future commit, in which we will open a
      client connection without setting an io_handle.
      816c6da5
    • Ken Brown's avatar
      Cygwin: FIFO: re-implement duplexers · 00b2e56d
      Ken Brown authored
      When opening a duplexer, open a client connection to the first client
      handler.  Previously we gave the duplexer a bogus write handle, which
      was just a duplicate of the first client handler's handle.  This meant
      that we had a pipe server with no clients connected, and all I/O
      attempts failed with STATUS_PIPE_LISTENING.
      
      Extend the last fcntl change to duplexers.
      
      Remove a now unused fifo_client_handler constructor, as well as the
      long unusued method fifo_client_handler::connect.
      
      Don't create the pipe in duplex mode; the server handle will only be
      used for reading.
      00b2e56d
    • Ken Brown's avatar
      Cygwin: FIFO: add 'record_connection' method · f3d1fe2f
      Ken Brown authored
      Future commits will have to re-use the code for recording a client
      connection.  For convenience, factor out this code into a new method.
      f3d1fe2f
    • Ken Brown's avatar
      Cygwin: FIFO: remove incorrect duplexer code · 1372021a
      Ken Brown authored
      raw_read had some code that was based on an incorrect implementation
      of duplexers.
      1372021a
    • Ken Brown's avatar
      Revert "Cygwin: check for STATUS_PENDING in fhandler_base::raw_read" · 674b4fe9
      Ken Brown authored
      This reverts commit 10bf30be.  It was
      made because an incorrect implementation of duplex FIFOs.
      674b4fe9
  5. May 05, 2019
  6. May 01, 2019
  7. Apr 30, 2019
  8. Apr 29, 2019
    • Faraz Shahbazker's avatar
      Fix order of eh_frame sections in linker scripts · ab2901c8
      Faraz Shahbazker authored
      The compiler driver positions the linker script at the end of the linker
      command-line, after crtend.o.  As a result, any INPUT objects and archive
      GROUPs introduced by the linker script are placed after crtend.o and the
      end-of-frame marker provided by crtend.o ends up in between .eh_frames
      instead of being at the end.
      
      This has always been a problem, but a binutils update to clean-up
      redundant NULL markers in .eh_frame exposes it as a execution failure in
      exception-handling tests.  This patch re-orders .eh_frames in all
      MIPS linker scripts so that the one from crtend.o is always placed last.
      
      libgloss/
      	* mips/array.ld: Re-order to place .eh_frame from crtend.o
      	after all other .eh_frame sections.
      	* mips/cfe.ld: Likewise.
      	* mips/ddb-kseg0.ld: Likewise.
      	* mips/ddb.ld: Likewise.
      	* mips/dve.ld: Likewise.
      	* mips/idt.ld: Likewise.
      	* mips/idt32.ld: Likewise.
      	* mips/idt64.ld: Likewise.
      	* mips/jmr3904app.ld: Likewise.
      	* mips/lsi.ld: Likewise.
      	* mips/mti32.ld: Likewise.
      	* mips/mti64.ld: Likewise.
      	* mips/mti64_64.ld: Likewise.
      	* mips/mti64_n32.ld: Likewise.
      	* mips/nullmon.ld: Likewise.
      	* mips/pmon.ld: Likewise.
      	* mips/sde32.ld: Likewise.
      	* mips/sde64.ld: Likewise.
      ab2901c8
  9. Apr 26, 2019
  10. Apr 23, 2019
    • Erik M. Bray's avatar
      Minor improvements to socket error handling: · 489e7e20
      Erik M. Bray authored
      * Change default fallback for failed winsock error -> POSIX error
        mappings to EACCES, which is a valid errno for more socket-related
        syscalls.
      
      * Added a few previously missing entries to the wsock_errmap table
        that have obvious POSIX errno.h analogues.
      489e7e20
  11. Apr 22, 2019
  12. Apr 21, 2019
  13. Apr 20, 2019
  14. Apr 19, 2019
    • Ken Brown's avatar
      Cygwin: FIFO: avoid hang after exec · 230c5df2
      Ken Brown authored
      Define fhandler:fifo::fixup_after_exec, which sets listen_client_thr
      and lct_termination_evt to NULL.  This forces the listen_client thread
      to restart on the first attempt to read after an exec.  Previously the
      exec'd process could hang in fhandler_fifo::raw_read.
      230c5df2
  15. Apr 18, 2019
    • Jozef Lawrynowicz's avatar
      MSP430: Make the inclusion of run_*_array fns depend on defined assembler symbols · f811485f
      Jozef Lawrynowicz authored
      Many of the MSP430 crt functions (e.g. to initialize bss) are linked
      "dynamically", based on symbols defined in the program.
      The GNU assembler defines the symbols corresponding to the crt
      functions by examining the section names in the input file.
      
      If GCC has been configured with --enable-initfini-array, then
      .init_array and .fini_array will hold pointers to global
      constructors/destructors. These sections can also hold functions that
      need to be executed for other purposes.
      
      The attached patch puts the __crt0_run_{preinit,init,fini}_array and
      __crt0_run_array functions in their own object files, so they will
      only be linked when needed.
      
      Successfully regtested the DejaGNU GCC testsuite using the binutils and
      newlib changes together with GCC trunk configured with
      --enable-initfini-array.
      f811485f
  16. Apr 16, 2019
    • Jozef Lawrynowicz's avatar
      38ecf252
    • Ken Brown's avatar
      Cygwin: FIFO: fix and simplify listen_client_thread · 2b4cf762
      Ken Brown authored
      Remove fifo_client_handler::connect and move its code into
      listen_client_thread.  That way we can check the return status when a
      client handler's connect_evt is signaled.  Previously we incorrectly
      assumed there was a successful connection.
      
      Also simplify listen_client_thread in the following ways:
      
      - Replace fhandler_fifo::disconnect_and_reconnect by a new
        delete_client_handler method.  Now we just delete invalid client
        handlers rather than trying to re-use them.
      
      - Try to maintain a client handler list that consists of connected
        client handlers and exactly one that is listening for a connection.
        This allows us to call WaitForMultipleObjects with only two wait
        objects.
      
      - Remove 'dummy_evt' from the fifo_client_handler struct; it is no
        longer needed.
      
      - On exit from listen_client_thread, delete the "extra" (listening)
        client handler.  Otherwise there could be a connection that doesn't
        get recorded in the client handler list.  This could happen when a
        file descriptor is being duplicated.
      2b4cf762
    • Ken Brown's avatar
      Cygwin: FIFO: improve raw_write · bb466278
      Ken Brown authored
      Don't set the write end of the pipe to non-blocking mode if the FIFO
      is opened in blocking mode.
      
      In fhandler_fifo::raw_write in blocking mode, wait for the write to
      complete rather than returning -1 with EAGAIN.
      
      If the amount to write is large, write in smaller chunks (of size
      determined by a new data member max_atomic_write), as in
      fhandler_base_overlapped.
      
      For convenience, add two new NTSTATUS codes, STATUS_THREAD_SIGNALED
      and STATUS_THREAD_CANCELED, to ntdll.h.
      bb466278
    • Ken Brown's avatar
      Cygwin: FIFO: start the listen_client thread when duping a reader · a7d08b3e
      Ken Brown authored
      Otherwise it doesn't get started until the dup'd fd tries to read,
      which delays client connections.
      a7d08b3e
    • Ken Brown's avatar
      Cygwin: FIFO: fix clone · 7b28776d
      Ken Brown authored
      After copyto is called, make the new fhandler's pipe_name point to the
      new fhandler's pipe_name_buf, which is a *copy* of the old fhandler's
      pipe_name_buf.  Previously, get_pipe_name would return the wrong
      result after a clone/dup, causing create_pipe_instance and open_pipe
      to fail.
      
      Also, stop the listen_client thread when cloning.  Otherwise the
      thread can keep accepting connections that the cloned fhandler won't
      know about.
      
      Do this via a new method fhandler_fifo::stop_listen_client, extracted
      from fhandler_fifo::close.
      7b28776d
    • Ken Brown's avatar
      Cygwin: FIFO: use a retry loop when opening a writer · c5bc7a80
      Ken Brown authored
      There may be short periods when there's no pipe instance available.
      Keep trying.
      c5bc7a80
    • Ken Brown's avatar
      Cygwin: FIFO: fix the use of the read_ready event · 6b20be09
      Ken Brown authored
      Make read_ready a manual reset event.  It should always be set shortly
      after startup of the listen_client thread and remain set until the
      thread terminates.  (We don't want writers to connect without being
      recorded in the client handler list.)
      
      Remove the unnecessary code that checks for read_ready when a reader
      is opening.
      6b20be09