summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/pseudo-reloc.cc
Commit message (Collapse)AuthorAgeFilesLines
* Silent relocation truncations considered harmfulMark Geisert2016-02-171-1/+1
| | | | | | | | | | | | This follows up from my msg re GMP-ECM failing its 'make check' on the main list https://cygwin.com/ml/cygwin/2016-02/msg00147.html . There's an error that ought to be reported during dynamic linking if the linked-to address is too far from the relocation site. However the error is not reported if __OPTIMIZE__ was #defined when building the Cygwin DLL. I can't see why optimization settings should affect this. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Reduce stack pressure throughout CygwinCorinna Vinschen2015-07-191-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc (initial_env): Reduce size of local path buffers to PATH_MAX. Allocate debugger_command from process heap. (init_windows_system_directory): Very early initialize new global variable global_progname. * dll_init.cc (dll_list::alloc): Make path buffer static. Explain why. (dll_list::populate_deps): Use tmp_pathbuf for local path buffer. * exceptions.cc (debugger_command): Convert to PWCHAR. (error_start_init): Allocate debugger_command and fill with wide char strings. Only allocate if NULL. (try_to_debug): Just check if debugger_command is a NULL pointer to return. Drop conversion from char to WCHAR and drop local variable dbg_cmd. * globals.cc (global_progname): New global variable to store Windows application path. * pinfo.cc (pinfo_basic::pinfo_basic): Just copy progname over from global_progname. (pinfo::status_exit): Let path_conv create the POSIX path to avoid local buffer. * pseudo_reloc.cc (__report_error): Utilize global_progname, drop local buffer. * smallprint.cc (__small_vsprintf): Just utilize global_progname for %P format specifier. (__small_vswprintf): Ditto. * strace.cc (PROTECT): Change to reflect x being a pointer. Reformat. (CHECK): Ditto. Reformat. (strace::activate): Utilize global_progname, drop local buffer. Fix formatting. (strace::vsprntf): Reduce size of local progname buffer to NAME_MAX. Copy and, if necessary, convert only the last path component to progname. (strace_buf_guard): New muto. (buf): New static pointer. (strace::vprntf): Use buf under strace_buf_guard lock only. Allocate buffer space for buf on Windows heap. * wow64.cc (wow64_respawn_process): Utilize global_progname, drop local path buffer. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* * pseudo-reloc.cc (__report_error): Raise size of module name buffer toCorinna Vinschen2014-05-191-2/+2
| | | | PATH_MAX. Fix length in call to GetModuleFileNameW (CID 59947).
* * Merge in cygwin-64bit-branch.Corinna Vinschen2013-04-231-3/+9
|
* * pseudo-reloc.cc (auto_protect_for): New function.Corinna Vinschen2012-09-021-18/+50
| | | | | (__write_memory): Call auto_protect_for to handle page protection. (do_pseudo_reloc): Call auto_protect_for to restore old page protection.
* whitespace cleanupChristopher Faylor2012-08-161-1/+1
|
* * pseudo-reloc.cc: Drop including wchar.h.Corinna Vinschen2012-07-121-3/+1
| | | | | | (__report_error): Define module as WCHAR. * advapi.cc: Drop including wchar.h. * kernel32.cc: Ditto.
* * Makefile.in: Add some more optimization flags for cygwait, malloc and ↵Christopher Faylor2012-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | path. Explain why -fomit-frame-pointer doesn't work right for passwd.o and path.o. Add -static to link command line for cygwin0.dll. * fhandler_disk_file.cc (fhandler_disk_file::facl): Reorganize slightly to silence compiler warning when compiling with -fstack-check. * net.cc (inet_ntop6): Initialize structure members to silence compiler warning when compiling with -fstack-check. * pseudo-reloc.cc (_pei386_runtime_relocator): Make this a C function. Detect NULL u. * winsup.h (_pei386_runtime_relocator): Declare this as extern "C". * lib/_cygwin_crt0_common.cc (_pei386_runtime_relocator): Call with NULL argument. * signal.cc (sigaction_worker): Eliminate last argument. Let callers report their own strace info. Regparmize. (sigaction): Reflect sigaction_worker changes. (siginterrupt): Ditto. * exceptions.cc: Update copyright.
* whitespace eliminationChristopher Faylor2011-06-061-3/+3
|
* Eliminate trailing whitespace in some files.Christopher Faylor2011-05-021-2/+2
| | | | | | * dll_init.cc (dll_list::alloc): Reset 'p' in forked process. * select.cc (select_stuff::wait): Move cleanup() closer to WFMO to minimize unavoidable (?) race.
* * Makefile.in (DLL_OFILES): Add pseudo-reloc.o.Christopher Faylor2010-05-071-89/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc (child_info_fork::handle_fork): Call _pei386_runtime_relocator here. (dll_crt0_1): Ditto for non-fork case. * dll_init.cc (dll::init): Complain more in comment. Clean up slightly. (dll_dllcrt0_1): Call _pei386_runtime_relocator when we know we have a filled-in per_process structure. * globals.cc (__cygwin_user_data): Accommodate new fields for _pei386_runtime_relocator. * pseudo-reloc.cc: New file adapted from old lib/pseudo-reloc.c. Include winsup.h directly. Collapse #ifdef __CYGWIN__ into one block. Perform minor whitespace code reformatting. (__report_error): Use small_printf to output error. (_pei386_runtime_relocator): Conditionalize for cygwin to take per_process pointer parameter. * winsup.h (_pei386_runtime_relocator): Declare. * include/cygwin/version.h (CYGWIN_VERSION_PER_PROCESS_API_VERSION_COMBINED): New macro. (CYGWIN_VERSION_USER_API_VERSION_COMBINED): Use above macro. (CYGWIN_VERSION_USE_PSEUDO_RELOC_IN_DLL): New macro. (CYGWIN_VERSION_API_MINOR): Bump to 227. * include/sys/cygwin.h: Remove obsolete comment. (per_process::unused2): Shorten. (per_process::pseudo_reloc_start): New field. (per_process::pseudo_reloc_end): Ditto. (per_process::image_base): Ditto. * lib/_cygwin_crt0_common.cc: Declare pseudo runtime externs needed for per_process structure. (_cygwin_crt0_common): Fill in pseudo_reloc runtime constants. * lib/pseudo-reloc-dummy.c: New file. Dummy function to satisify ld. * lib/pseudo-reloc.c: Delete.
* Correct pseudo-reloc size bug wrt error messagesCharles Wilson2009-10-261-2/+3
|
* Sync pseudo-reloc.c with mingw64Charles Wilson2009-10-251-82/+76
|
* Support pseudo-reloc version 2Charles Wilson2009-10-071-14/+340
|
* * lib/pseudo-reloc.c: New file.Christopher Faylor2002-12-091-0/+46
* lib/_cygwin_crt0_common.cc: Perform pseudo-relocs during initialization of cygwin binary (.exe or .dll).