Corinna Vinschen [Sat, 19 Feb 2005 19:58:38 +0000 (19:58 +0000)]
* localtime.cc: Temporary implementation of setting __tzrule's offset
member to be used by strftime.
(__tzrule): New global variable.
(tzparse): Set __tzrule's offset member appropriately.
Corinna Vinschen [Thu, 17 Feb 2005 12:41:49 +0000 (12:41 +0000)]
* fhandler_disk_file.cc (fhandler_disk_file::fstat): Set st_ctime if
has_changed flag is set.
(fhandler_disk_file::touch_ctime): Reset has_changed flag on success.
Jeff Johnston [Wed, 16 Feb 2005 21:15:37 +0000 (21:15 +0000)]
2005-02-16 Eric Blake <ebb9@byu.net>
* libc/time/time.tex: Improve the documentation.
* libc/time/strftime.c: Improve the documentation.
(iso_year_adjust): New helper function.
(strftime): Simplify '%E' and '%O'. Change '%c' to use
recursion. Fix '%C', '%y', and '%Y' to deal with years with more
than 4 characters. Combine '%d' and '%e'. Implement '%D', '%F',
'%g', '%G', '%n', '%R', '%t', '%T', '%u', '%V', '%X', and '%z'.
Avoid core dumps on valid inputs (maxsize == 0, or
tim_p->tm_isdst > 1).
bfd/:
2005-02-15 Nigel Stephens <nigel@mips.com>
Maciej W. Rozycki <macro@mips.com>
* elf32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
reloc howtos. Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
(elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
(elf_mips16_gprel_howto): Likewise. Redefine src_mask and
dst_mask.
(mips16_gprel_reloc): Remove bit shuffling; call
_bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
and _bfd_mips16_elf_reloc_shuffle() instead.
(mips16_reloc_map): New reloc map for MIPS16 relocs.
(bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
relocs.
(mips_elf32_rtype_to_howto): Fetch MIPS16 howtos from
elf_mips16_howto_table_rel.
* elf64-mips.c (mips16_elf64_howto_table_rel): New array for
MIPS16 REL reloc howtos. Add R_MIPS16_HI16 and R_MIPS16_LO16
relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
(elf_mips16_jump_howto): Move into mips16_elf64_howto_table_rel.
(elf_mips16_gprel_howto): Likewise. Redefine src_mask and
dst_mask.
(mips16_elf64_howto_table_rela): New array for MIPS16 RELA
reloc howtos. Add R_MIPS16_26, R_MIPS16_GPREL, R_MIPS16_HI16 and
R_MIPS16_LO16 relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16
placeholders.
(mips16_gprel_reloc): Remove bit shuffling; call
_bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
and _bfd_mips16_elf_reloc_shuffle() instead.
(mips16_reloc_map): New reloc map for MIPS16 relocs.
(bfd_elf64_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
relocs.
(mips_elf64_rtype_to_howto): Fetch MIPS16 howtos from
mips16_elf64_howto_table_rela or mips16_elf64_howto_table_rel.
* elfn32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
REL reloc howtos. Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
(elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
(elf_mips16_gprel_howto): Likewise. Redefine src_mask and
dst_mask.
(mips16_gprel_reloc): Remove bit shuffling; call
_bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
and _bfd_mips16_elf_reloc_shuffle() instead.
(mips16_reloc_map): New reloc map for MIPS16 relocs.
(bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
relocs.
(mips_elf_n32_rtype_to_howto): Fetch MIPS16 howtos from
elf_mips16_howto_table_rela or elf_mips16_howto_table_rel.
* elfxx-mips.c (_bfd_mips16_elf_reloc_unshuffle): New function to
handle bit shuffling for MIPS16 relocs.
(_bfd_mips16_elf_reloc_shuffle): Likewise.
(_bfd_mips_elf_lo16_reloc): Use _bfd_mips16_elf_reloc_unshuffle()
and _bfd_mips16_elf_reloc_shuffle().
(_bfd_mips_elf_generic_reloc): Likewise.
(mips_elf_calculate_relocation): Likewise. Handle R_MIPS16_HI16
and R_MIPS16_LO16.
(mips_elf_obtain_contents): Remove bit shuffling.
(mips_elf_perform_relocation): Likewise; call
_bfd_mips16_elf_reloc_unshuffle() and _bfd_mips16_elf_reloc_shuffle()
instead.
(_bfd_mips_elf_relocate_section): Likewise. Handle R_MIPS16_HI16
and R_MIPS16_LO16.
* elfxx-mips.h (_bfd_mips16_elf_reloc_unshuffle): Declare.
(_bfd_mips16_elf_reloc_shuffle): Likewise.
* reloc.c (BFD_RELOC_MIPS16_HI16): New reloc.
(BFD_RELOC_MIPS16_HI16_S): Likewise.
(BFD_RELOC_MIPS16_LO16): Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
gas/:
2005-02-15 Nigel Stephens <nigel@mips.com>
Maciej W. Rozycki <macro@mips.com>
* config/tc-mips.c (reloc_needs_lo_p): Handle
BFD_RELOC_MIPS16_HI16_S.
(fixup_has_matching_lo_p): Handle BFD_RELOC_MIPS16_LO16.
(append_insn): Add BFD_RELOC_MIPS16_GPREL, BFD_RELOC_MIPS16_HI16_S
and BFD_RELOC_MIPS16_LO16 to relocs to suppress overflow
complaints on.
(mips16_ip): Resolve BFD_RELOC_MIPS16_HI16_S,
BFD_RELOC_MIPS16_HI16 and BFD_RELOC_MIPS16_LO16 for constants.
Call my_getSmallExpression() to parse percent operators.
(percent_op_match, mips_percent_op): Separate definitions.
(mips16_percent_op): Define percent operators for the MIPS16 mode.
(parse_relocation): Handle the MIPS16 mode using
mips16_percent_op.
(md_apply_fix3): Handle BFD_RELOC_MIPS16_HI16,
BFD_RELOC_MIPS16_HI16_S and BFD_RELOC_MIPS16_LO16.
gas/testsuite/:
2005-02-15 Nigel Stephens <nigel@mips.com>
Maciej W. Rozycki <macro@mips.com>
* gas/mips/mips16-hilo.d: New test for the R_MIPS16_HI16 and
R_MIPS16_LO16 relocs.
* gas/mips/mips16-hilo-n32.d: Likewise, for the n32 ABI.
* gas/mips/mips16-hilo.s: Source for the new tests.
* gas/mips/mips.exp: Run the new tests.
include/:
2005-02-15 Nigel Stephens <nigel@mips.com>
Maciej W. Rozycki <macro@mips.com>
* elf/mips.h (R_MIPS16_GOT16): New reloc code.
(R_MIPS16_CALL16): Likewise.
(R_MIPS16_HI16): Likewise.
(R_MIPS16_LO16): Likewise.
(R_MIPS16_min): New fake reloc code.
(R_MIPS16_max): Likewise.
ld/testsuite/:
2005-02-15 Nigel Stephens <nigel@mips.com>
Maciej W. Rozycki <macro@mips.com>
* ld-mips-elf/mips16-hilo.d: New test for the R_MIPS16_HI16 and
R_MIPS16_LO16 relocs.
* ld-mips-elf/mips16-hilo-n32.d: Likewise, for the n32 ABI.
* ld-mips-elf/mips16-hilo.s: Auxiliary source for the new tests.
* ld-mips-elf/mips-elf.exp: Run the new tests.
Corinna Vinschen [Fri, 11 Feb 2005 15:37:26 +0000 (15:37 +0000)]
* fhandler.cc (fhandler_base::raw_write): Mark as changed on
successful write.
* fhandler.h (fhandler_base::status_flags): Add 'has_changed' flag.
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call
fhandler_disk_file's own open and close instead of open_fs and
close_fs. Mark as changed on success.
(fhandler_disk_file::fchown): Ditto.
(fhandler_disk_file::facl): Ditto.
(fhandler_disk_file::ftruncate): Ditto.
(fhandler_base::open_fs): Mark as changed when O_TRUNC flag on existing
file is set.
(fhandler_disk_file::close): Set st_ctime if has_changed flag is set.
* cygthread.cc (cygthread::release): Reset ev here if it exists.
(cygthread::terminate_thread): Eliminat racy code which reset ev and
thread_sync. Remove a few nonsensical inuse checks. Exit at the bottom.
(cygthread::detach): Rewrite to again try to ensure that we don't say we're
signalled when we are not signalled.
* fhandler.cc (fhandler_base::raw_read): Revert to signalling read success
quickly.
* pipe.cc (fhandler_pipe::close): Use base method to close handle.
* sigproc.h (WAIT_SIG_PRIORITY): Just trundle along at normal priority to allow
the pipe thread to do its thing if possible.
* pinfo.h (pinfo::zap_cwd): Declare new function.
(pinfo::zap_cwd): Move 'cd out of the way code' here.
(pinfo::exit): Use it here.
* spawn.cc (spawn_guts): And here.
Danny Smith [Thu, 10 Feb 2005 01:19:43 +0000 (01:19 +0000)]
2005-02-10 Jiri Malak <Jiri.Malak@iol.cz>
Danny Smith <dannysmith@users.sourceforge.net>
* lib/directx/dinput_private.h (ATTRIBUTE_TEXT_SECTION): New
define for Open Watcom portability.
* lib/directx/(dinput_joy.c, dinput_joy2.c, dinput_kbd.c,
dinput_mouse.c, dinput_mouse2.c): Use new macro in definition
of local c_rgodfDI* objects. Replace .rdata section attribute
with 'const' keyword in definition of global c_dfDI* objects.
Jan Beulich [Wed, 9 Feb 2005 08:05:43 +0000 (08:05 +0000)]
gas/testsuite/
2005-02-09 Jan Beulich <jbeulich@novell.com>
* gas/i386/intelok.s: Remove comments disabling alternative forms of
fbld, fbstp, and fldcw.
* gas/i386/intelok.d: Expect two instances of fbld, fbstp, and fldcw.
include/opcode/
2005-02-09 Jan Beulich <jbeulich@novell.com>
PR gas/707
* i386.h (i386_optab): Add x_Suf to fbld and fbstp. Add w_Suf and
FloatMF to fldcw, fstcw, fnstcw, and the memory formas of fstsw and
fnstsw.
* times.cc (timeval_to_filetime): Define first parameter const.
(utimes): Define second parameter to const according to SUSv3.
(utime): Ditto.
* include/sys/utime.h (utime) : Change declaration accordingly.
* libc/include/pwd.h (struct passwd): Change pw_uid and pw_gid
members to uid_t and gid_t according to SUSv3.
* libc/include/sys/time.h (utimes): Change second parameter
to const according to SUSv3.
Jeff Johnston [Tue, 8 Feb 2005 01:05:50 +0000 (01:05 +0000)]
2005-02-07 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/findfp.c (__sinit): Protect with new lock.
(__sinit_lock): New lock.
(__sinit_lock_acquire, __sinit_lock_release): New functions.
* libc/stdio/local.h: Add reference to new __sinit locking
functions.
* exceptions.cc: Make windows_system_directory non-static.
* pinfo.cc (pinfo::exit): Change innocuous cd'ed location to one that is more
likely to exist.
* cygthread.h (cygthread::terminate_thread): Reflect return value.
* cygthread.cc (cygthread::detach): Be more careful about ensuring that sigwait
is properly waited for to avoid later missynchronization.
(cygthread::terminate_thread): Return true if thread was actually terminated
and all handles were closed.
* fhandler_base.cc (fhandler_base::raw_read): Use signal_read_state rather than
raw calls to win32 api.
(fhandler_base::read): Ditto.
* fhandler.h (fhandler_pipe::fixup_after_exec): Use method to create read_state
signalling.
(fhandler_pipe::create): Ditto.
* Makefile.in: Make some more files -fomit-frame-pointer.
Alan Modra [Thu, 3 Feb 2005 03:30:38 +0000 (03:30 +0000)]
include/
* bfdlink.h (struct bfd_link_hash_entry): Add u.undef.weak.
bfd/
* linker.c (_bfd_generic_link_add_one_symbol): Set u.undef.weak.
* elflink.c (elf_smash_syms): Restore symbols that were undefweak
before the as-needed lib was loaded. Abort on unexpected refs.
* cris/Makefile.in (ALL_INSTALL_FILES): New macro.
(ALL_INSTALL_FILES_NEWLIB_COPY): New macro.
(all): Use ALL_INSTALL_FILES instead of its contents. Add
ALL_INSTALL_FILES_NEWLIB_COPY.
($(objroot)/newlib/%, $(objroot)/newlib/libnosys.a): New rules
* cygthread.cc (cygthread::terminate_thread): Wait briefly for notification
event in the event that the thread was actually in the process of exiting.
* pipe.cc (fhandler_pipe::dup): read_state is not supposed to be inheritable.
Fix that.
* path.cc (path_conv::check): Set symlen = 0 to avoid a compiler warning.
* devices.h (devices::parsedisk): Declare new function.
* devices.in (devices::parsedisk): Define new function.
* dtable.cc (dtable::init_std_file_from_handle): Use device numbers rather than
name.
* fhandler_proc.cc (format_proc_partitions): Use parsedisk to generate disk
names from numeric codes. (This was broken on two of my systems previously and
is still broken now)
* fhandler.cc (fhandler_base::get_proc_fd_name): Don't generate
"device:" entry.
* fhandler.h (fhandler_socket::open): New method.
(fhandler_pipe::open): New method.
* fhandler_proc.cc (fhandler_proc::exists): Return -2 in case of
/proc/self.
* fhandler_process.cc (fhandler_process::exists): Return -2 in
case of symlinks, -3 for pipes and -4 for sockets.
(fhandler_process::fstat): Handle pipes and sockets.
(fhandler_process::open): Handle opening /proc/<pid>/fd.
(fhandler_process::fill_filebuf): Generate empty names for
non exisiting file descriptors.
* fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Always
generate "socket:[number]" strings as on Linux.
(fhandler_socket::open): New method.
(fhandler_socket::fstat): Always return socket type.
* path.cc (symlink_info::set): Remove unused second parameter.
(path_conv::check): Handle pipes and sockets in /proc.
Set correct device type for AF_LOCAL sockets.
* pinfo.cc (_pinfo::commune_recv): Generate empty names for
non exisiting file descriptors.
(_pinfo::fd): Ditto.
* pipe.cc (fhandler_pipe::open): New method.
* smallprint.c (rnarg): New macro.
(rnargLL): Ditto.
(__rn): Rename from 'rn', add a mask argument, and use the mask argument to
control how many significant digits to care about.
(__small_vsprintf): Use __rn, rnarg, rnargLL, as appropriate.
Corinna Vinschen [Mon, 31 Jan 2005 10:28:55 +0000 (10:28 +0000)]
* cygheap.h (class cygheap_fdenum): New class to enumerate used
fhandlers.
* dtable.h (class dtable): Add cygheap_fdenum as friend class.
* fhandler.h (fhandler_base::get_proc_fd_name): New virtual method
to return a name for /proc/<pid>/fd.
(fhandler_socket::get_proc_fd_name): Ditto.
(fhandler_pipe::get_proc_fd_name): Ditto.
(fhandler_virtual::opendir): Make virtual method.
(fhandler_process::opendir): New method.
* fhandler.cc (fhandler_base::get_proc_fd_name): New method.
* fhandler_process.cc: Include ctype.h.
(PROCESS_FD): Define.
(process_listing): Add "fd".
(fhandler_process::exists): Fix comment. Return 1 in case of "fd"
directory. Handle files below "fd".
(fhandler_process::fstat): Drop "self" handling. Set correct link
count for directories.
(fhandler_process::opendir): New method to handle "fd" directory.
(fhandler_process::readdir): Add "fd" handling.
(fhandler_process::open): Drop "self" handling.
(fhandler_process::fill_filebuf): Ditto. Add "fd" handling. Fix
"maps" output string.
* fhandler_registry.cc (fhandler_registry::fstat): Set correct link
count for directories.
* fhandler_socket.cc (fhandler_socket::get_proc_fd_name): New method.
* path.cc (symlink_info::set): Fix thinko.
* pinfo.cc (_pinfo::commune_recv): Rename pathbuf to path throughout.
Drop local path variable in PICOM_FIFO case. Fix debug output.
Close handles as early as possible. Add PICOM_FDS and PICOM_FD
handling.
(_pinfo::commune_send): Add PICOM_FDS and PICOM_FD handling.
(_pinfo::fd): New method.
(_pinfo::fds): New method.
* pinfo.h (enum picom): Add PICOM_FDS and PICOM_FD.
(_pinfo::fd): Declare.
(_pinfo::fds): Declare.
* pipe.cc (fhandler_pipe::get_proc_fd_name): New method.
Corinna Vinschen [Sat, 29 Jan 2005 13:34:34 +0000 (13:34 +0000)]
* smallprint.c (rn): Change uval to unsigned long long to fix 64 bit
handling.
* fhandler_process.cc (format_process_maps): Print major, minor and
inode numbers correctly.
* configure.in (noconfigdirs) <crisv32-*-*>: Match like cris-*-*.
<crisv32-*-*, cris-*-*>: Only disable target-newlib and
target-libgloss when not *-*-elf and *-*-aout.
* configure: Regenerate.
* callback.h (struct host_callback_struct): New members pipe,
pipe_empty, pipe_nonempty, ispipe, pipe_buffer and
target_sizeof_int.
(CB_SYS_pipe): New macro.
Corinna Vinschen [Wed, 26 Jan 2005 13:07:48 +0000 (13:07 +0000)]
* syscalls.cc (setpriority): Implement PRIO_PGRP, PRIO_USER and
setting priority in other Cygwin processes.
(getpriority): Implement PRIO_PGRP, PRIO_USER and getting nice value
from other processes.
* pinfo.h (pinfo::init): Make third parameter non-optional and propagate change
throughout.
* pinfo.cc (set_myself): Pass INVALID_HANDLE_POINTER if h is NULL.
(pinfo::init): Make third parameter non-optional. Eliminate use of PID_EXECED
as an argument. Put setting of handle back inside loop but reorganize to try
to open it only when necessary.
Corinna Vinschen [Tue, 25 Jan 2005 22:45:11 +0000 (22:45 +0000)]
* cygwin.din: Export getpriority and setpriority.
* fork.cc (fork_parent): Copy parent's nice value into child.
* spawn.cc (spawn_guts): Ditto.
* miscfuncs.cc (winprio_to_nice): New function.
(nice_to_winprio): Ditto.
* pinfo.cc (pinfo_init): If parent is not a Cygwin process, set
default nice value according to current Win32 priority class.
* pinfo.h (class _pinfo): Add nice member.
* syscalls.cc (setpriority): New function, only implementing
PRIO_PROCESS for now.
(getpriority): Ditto.
(nice): Just call setpriority.
* wincap.h (wincaps::has_extended_priority_class): New element.
* wincap.cc: Implement above element throughout.
* winsup.h: Add prototypes for winprio_to_nice and nice_to_winprio.
* include/limits.h (NZERO): New define.
* include/cygwin/types.h (id_t): New datatype.
* include/cygwin/version.h: Bump API minor version.
* include/sys/resource.h: Add PRIO_XXX defines and prototypes for
getpriority and setpriority.
Jeff Johnston [Mon, 24 Jan 2005 18:46:09 +0000 (18:46 +0000)]
2005-01-24 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/string.h: Remove Linux-specific declaration of
strsignal and add #include <sys/string.h>.
* libc/include/sys/string.h: New file.
* libc/include/sys/linux/sys/string.h: New file with strsignal
declaration deleted above.
* spawn.cc (spawn_guts): Perform same "cd" as in pinfo::exit below to make sure
that a stub process does not keep the current working directory busy after the
"execed" process has exited.
* pinfo.cc (pinfo::init): Move everything but the MapViewOfFileEx out of the
loop since trying multiple times to call CreateFileMapping doesn't make much
sense. Try to structure the loop a little better so that exiting with a break
does the right thing.
(pinfo::release): Release shared memory area if it exists and close handle if
it exists.
* how-programming.texinfo: Add details about building a debugging version of the DLL.
* how-using.texinfo: Correct rxvt README location.
* install.texinfo: Add mount -m note to uninstall instructions.
* pinfo.cc (pinfo::maybe_set_exit_code_from_windows): Make sure that process
has exited before getting an error code.
(pinfo::exit): "cd" to innocuous location before exiting to make sure that
process does not keep the current working directory busy while it is in the
process of really exiting.
Fred Fish [Fri, 21 Jan 2005 19:42:08 +0000 (19:42 +0000)]
2005-01-21 Fred Fish <fnf@specifixinc.com>
* mips.h: Change INSN_ALIAS to INSN2_ALIAS.
Change INSN_WRITE_MDMX_ACC to INSN2_WRITE_MDMX_ACC.
Change INSN_READ_MDMX_ACC to INSN2_READ_MDMX_ACC.