1. 04 3月, 2015 1 次提交
    • R
      make all objects used with atomic operations volatile · 56fbaa3b
      Rich Felker 提交于
      the memory model we use internally for atomics permits plain loads of
      values which may be subject to concurrent modification without
      requiring that a special load function be used. since a compiler is
      free to make transformations that alter the number of loads or the way
      in which loads are performed, the compiler is theoretically free to
      break this usage. the most obvious concern is with atomic cas
      constructs: something of the form tmp=*p;a_cas(p,tmp,f(tmp)); could be
      transformed to a_cas(p,*p,f(*p)); where the latter is intended to show
      multiple loads of *p whose resulting values might fail to be equal;
      this would break the atomicity of the whole operation. but even more
      fundamental breakage is possible.
      
      with the changes being made now, objects that may be modified by
      atomics are modeled as volatile, and the atomic operations performed
      on them by other threads are modeled as asynchronous stores by
      hardware which happens to be acting on the request of another thread.
      such modeling of course does not itself address memory synchronization
      between cores/cpus, but that aspect was already handled. this all
      seems less than ideal, but it's the best we can do without mandating a
      C11 compiler and using the C11 model for atomics.
      
      in the case of pthread_once_t, the ABI type of the underlying object
      is not volatile-qualified. so we are assuming that accessing the
      object through a volatile-qualified lvalue via casts yields volatile
      access semantics. the language of the C standard is somewhat unclear
      on this matter, but this is an assumption the linux kernel also makes,
      and seems to be the correct interpretation of the standard.
      56fbaa3b
  2. 16 4月, 2014 1 次提交
    • R
      add working vdso clock_gettime support, including static linking · 58e75db4
      Rich Felker 提交于
      the vdso symbol lookup code is based on the original 2011 patch by
      Nicholas J. Kain, with some streamlining, pointer arithmetic fixes,
      and one symbol version matching fix.
      
      on the consumer side (clock_gettime), per-arch macros for the
      particular symbol name and version to lookup are added in
      syscall_arch.h, and no vdso code is pulled in on archs which do not
      define these macros. at this time, vdso is enabled only on x86_64.
      
      the vdso support at the dynamic linker level is no longer useful to
      libc, but is left in place for the sake of debuggers (which may need
      the vdso in the link map to find its functions) and possibly use with
      dlsym.
      58e75db4
  3. 15 4月, 2014 1 次提交
  4. 08 8月, 2011 1 次提交
    • R
      use weak aliase rather than weak reference for vdso clock_gettime · cdfb725c
      Rich Felker 提交于
      this works around pcc's lack of working support for weak references,
      and in principle is nice because it gets us back to the stage where
      the only weak symbol feature we use is weak aliases, nothing else.
      
      having fewer dependencies on fancy linker features is a good thing.
      cdfb725c
  5. 24 7月, 2011 3 次提交
  6. 20 3月, 2011 1 次提交
  7. 10 3月, 2011 1 次提交
    • R
      fix errno behavior in clock_* functions · 1b538acb
      Rich Felker 提交于
      these functions are specified inconsistent in whether they're
      specified to return an error value, or return -1 and set errno.
      hopefully now they all match what POSIX requires.
      1b538acb
  8. 20 2月, 2011 1 次提交
  9. 12 2月, 2011 1 次提交