Commit Graph

45 Commits

Author SHA1 Message Date
Siddhesh Poyarekar ba384f6ed9 C++11 thread_local destructors support
This feature is specifically for the C++ compiler to offload calling
thread_local object destructors on thread program exit, to glibc.
This is to overcome the possible complication of destructors of
thread_local objects getting called after the DSO in which they're
defined is unloaded by the dynamic linker.  The DSO is marked as
'unloadable' if it has a constructed thread_local object and marked as
'unloadable' again when all the constructed thread_local objects
defined in it are destroyed.
2013-02-18 19:08:21 +05:30
Chris Metcalf 176f2fe0a1 tilegx: fix ldd to work with both tilegx64 and tilegx32
This uses the same ldd-rewrite.sed hook as other platforms, with
the minor tweak that tilegx uses /lib (64-bit) and /lib32 (32-bit).
2013-01-10 10:16:06 -05:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Chris Metcalf fdfc65d21f tile: support lll_futex_timed_wait_bitset 2012-12-28 12:13:01 -05:00
Chris Metcalf 2bc2d8e823 tile: fix DWARF bug in clone() for created thread
Previously, we would see a bad frame in the gdb backtrace output, e.g.:

  (gdb) bt
  #0  foo () at foo.c:5
  #1  0x000000aaaab68ee8 in start_thread () from /lib/libpthread.so.0
  #2  0x000000aaaad01c88 in clone () from /lib/libc.so.6
  #3  0x0000000000000000 in ?? ()

With this change the bogus frame #3 is gone and we have the
same output as x86 does for the same program.
2012-12-21 15:29:55 -05:00
Chris Metcalf ebdcf03979 tile: remove redundant defines of libc_fetestexcept, etc. in s_fmaf.c 2012-11-29 11:17:29 -05:00
Chris Metcalf c10f7382a3 tile: update libm-test-ulps for new tests 2012-11-20 15:06:38 -05:00
Chris Metcalf 73deba6d3c tile: Fix __bswap_64 return type in tile bits/byteswap.h 2012-11-20 15:05:59 -05:00
Chris Metcalf 3d45177146 tile: remove redundant defines of libc_fetestexcept, etc. in s_fma.c 2012-11-20 15:05:32 -05:00
Chris Metcalf 87ae5e366e Update language in ChangeLog.tile. 2012-11-07 13:19:54 -05:00
Chris Metcalf fdf689a977 tile: use memcpy in memmove when possible 2012-11-06 22:19:31 -05:00
Chris Metcalf 351dc60c55 tile: use atomic op to unlock pthread_spinlock_t
Atomic ops are issued directly from the core, rather than
potentially sitting in the write buffer, so can improve the
performance of other waiters.  In addition, if we didn't end
up pulling a copy of the cache line where the lock is into cache,
by using an atomic op we don't have to acquire the cache line
before we can unlock.
2012-11-06 09:50:47 -05:00
Chris Metcalf a0bce338e8 Make ieee754 fma tolerate architectures without exception support. 2012-11-06 09:48:53 -05:00
Chris Metcalf fedff58953 tile: support very large shared objects
With gcc 4.8 tilegx has support for -mcmodel=large, to tolerate very
large shared objects.  This option changes the compiler output to
not include direct jump instructions, which have a range of only
2^30, i.e +/- 512MB.  Instead the compiler marshalls the target PCs
into registers and then uses jump- or call-to-register instructions.

For glibc, the upshot is that we need to arrange for a few functions
to tolerate the possibility of a large range between the PC and
the target.  In particular, the crti.S and start.S code needs
to be able to reach from .init to the PLT, as does gmon-start.c.
The elf-init.c code has the reverse problem, needing to call from
libc_nonshared.a (linked at the end of shared objects) back to the
_init section at the beginning.

No other functions in *_nonshared.a need to be built this way, as
they only call the PLT (or potentially each other), but all of that
code is linked at the very end of the shared object.

We don't build the standard -static archives with this option as the
performance cost is high enough and the use case is rare enough that
it doesn't seem worthwhile.  Instead, we would encourage developers
who need the -static model with huge executables to build a private
copy of glibc and configure it with -mcmodel=large.

Note that libc.so et al don't need any changes; the only changes
are for code that is statically linked into user code built with
-mcmodel=large.

For the assembly code, I just rewrote it so that it unconditionally
uses the large model.  To be able to pass -mcmodel=large to
csu/elf-init.c and csu/gmon-start.c, I need to check to see if the
compiler supports that flag, since gcc 4.7 doesn't; I added the
support by creating a small Makefile fragment that just runs the
compiler to check.
2012-11-06 09:48:49 -05:00
Chris Metcalf e7776fefa7 tile: improve simulator notification for relative paths in dlopen
Normally, the simulator is notified of absolute pathnames by the
_dl_load_hook hook.  However, when a relative pathname is used, the
simulator may not know that the relative path matches a path that
it could figure out in the file system that it has access to.
Instead we provide a simplified version of the realpath function
so we can pass a plausible absolute pathname to the simulator.

Since we're now doing more work at object load time, we also add
a guard so we do no work at all if we're not running on the simulator.
2012-11-06 09:24:44 -05:00
Chris Metcalf cd84016efe Optimize tile (mostly tilegx) memcpy and memmove performance.
- Override <memcopy.h> so we use full 8-byte word copies on tilegx32
  for memmove, then use op_t in memcpy instead of the previous
  locally-defined word_t just to avoid proliferating identical types.
- Fix bug in memcpy prefetch that caused us to never prefetch past
  the first cache line.
- Optimize misaligned memcpy by inlining _wordcopy_fwd_dest_aligned
  instead of just doing a dumb word-at-a-time copy.
- Make memcpy safe for forward copies by doing all the loads from
  a given cache line prior to doing a wh64 (cache line zero-fill)
  on the destination.  Remove now-redundant src == dst check.
- Copy and optimize the generic wordcopy.c routines to use the tile
  "double align" instruction instead of the MERGE macro; to avoid
  offset addressing mode (which tile doesn't have) by rewriting the
  pointer math to load and store with a zero index; and to use
  post-increment addresses in the inner loops to improve scheduling.
2012-11-06 09:24:19 -05:00
Joseph Myers fbeafedeea Make fenv.h FE_* macros usable in #if (bug 3439). 2012-11-03 17:07:56 +00:00
Chris Metcalf 0244426b93 tile: Account for new tests (missed test-double changes) 2012-11-03 08:46:09 -04:00
Chris Metcalf 47cc1490e0 Invoke DL_AFTER_LOAD if defined
This hook is useful for any arch-specific functionality that
should be done on loaded objects.  For the tile architecture,
the hook is already provided (though we switch to using the new
macro name with this commit) and implements a simulator notifier
so that the simulator can load Elf symbols to match the object
and generate better error messages for PC's.

Also, remove a spurious definition of DL_UNMAP in dl-runtime.c
2012-10-30 14:16:18 -04:00
Chris Metcalf d44a6f8b99 tile: improve ABI and #include use in gettimeofday vdso support 2012-10-30 14:11:54 -04:00
Chris Metcalf 5ff3789785 tile: update libm-test-ulps for new tests 2012-10-30 14:11:22 -04:00
Chris Metcalf d11260f86a tile: add vDSO support for gettimeofday() 2012-10-29 13:47:57 -04:00
Roland McGrath 6e6249d0b4 BZ#14743: Move clock_* symbols from librt to libc. 2012-10-24 14:50:46 -07:00
Chris Metcalf b8d7c0968c tilegx: add optimized sched_getcpu() using TILE_COORD SPR
We can discover our x,y coordinate in the core mesh with an
mfspr instruction, multiply y by the core mesh width, and have
the core number without needing to ask the kernel.
2012-10-12 14:26:25 -04:00
Siddhesh Poyarekar 40d4a87bb5 Split my last ChangeLog entry into respective arch-specific files 2012-10-02 09:28:18 +05:30
Chris Metcalf f737a641b6 tile: update libm-test-ulps for new tests 2012-09-17 14:57:49 -04:00
Chris Metcalf 48bac3debb tile: fix type of prfpregset_t in <sys/procfs.h>
The previous dummy definition (as type int) was fine in general, since
tile doesn't have floating-point registers, but it confused gdb's
configure, leading to later compile errors.  This change also makes
prfpregset_t parallel to prgregset_t, which seems like generally the
right thing regardless of the non-existence of the actual registers :-)
2012-09-06 11:43:56 -04:00
Chris Metcalf 9207320187 tile: Add BZ to Changelog and update NEWS 2012-09-06 11:37:07 -04:00
Chris Metcalf 053406fa70 tile: BZ#14237: fix __tls_get_addr bug initializing new modules
We were missing a check for TLS_DTV_UNALLOCATED; if set, we need
to go to the slow path.
2012-09-06 11:25:04 -04:00
Joseph Myers ad845c0be9 Remove __ASSUME_STAT64_SYSCALL. 2012-08-27 19:36:04 +00:00
Joseph Myers 0e1d99119e Remove __ASSUME_FADVISE64_64_SYSCALL. 2012-08-21 21:07:22 +00:00
Joseph Myers 348363b2c3 Remove __ASSUME_MMAP2_SYSCALL. 2012-08-20 14:37:27 +00:00
Joseph Myers f2c05b9ecf Remove __ASSUME_CLONE_THREAD_FLAGS. 2012-08-14 22:34:04 +00:00
Joseph Myers b36137f1d6 Remove __ASSUME_TGKILL. 2012-08-08 23:22:53 +00:00
Chris Metcalf 2fbd74d8c9 tile: Get rid of ASM_TYPE_DIRECTIVE 2012-08-02 15:48:14 -04:00
Joseph Myers 23bddc0668 Remove __ASSUME_FCNTL64. 2012-08-01 21:27:58 +00:00
Andreas Jaeger b1b2aaf8eb Merge Linux 3.5 ptrace changes
(__ptrace_eventcodes): Add new value PTRACE_EVENT_SECCOMP from Linux 3.5.
(__ptrace_setoptions): Add new value PTRACE_O_TRACESECCOMP, adjust PTRACE_O_MASK.
2012-07-26 13:13:26 +02:00
Andreas Jaeger bfc07087bf Merge _sigsys changes from Linux 3.5 2012-07-26 13:11:18 +02:00
Florian Weimer 0c7936d5e9 Fix up ChangeLog entries 2012-07-25 20:46:19 +02:00
Chris Metcalf f110915184 tile: exit with status zero on makecontext return with NULL uc_link 2012-07-17 14:40:48 -04:00
Chris Metcalf 6df48a9b8b tile: update libm test ULPs 2012-07-17 14:40:48 -04:00
Chris Metcalf e3e5d6470d Move tile c++-types baselines to sysdeps directories. 2012-07-17 14:40:47 -04:00
Chris Metcalf ba7fefc8e0 tile: correct typo in comment 2012-07-10 10:38:18 -04:00
Chris Metcalf 5f5bcf71f7 tile: Convert ASM_GLOBAL_DIRECTIVE to .globl 2012-07-10 10:38:18 -04:00
Joseph Myers e64ac02c24 Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00