1. 24 4月, 2015 1 次提交
    • R
      make __init_tp function static when static linking · 5f51d529
      Rich Felker 提交于
      this slightly reduces the code size cost of TLS/thread-pointer for
      static linking since __init_tp can be inlined into its only caller and
      removed. this is analogous to the handling of __init_libc in
      __libc_start_main, where the function only has external linkage when
      it needs to be called from the dynamic linker.
      5f51d529
  2. 23 4月, 2015 1 次提交
    • R
      fix regression in x86_64 math asm with old binutils · 18938c29
      Rich Felker 提交于
      the implicit-operand form of fucomip is rejected by binutils 2.19 and
      perhaps other versions still in use. writing both operands explicitly
      fixes the issue. there is no change to the resulting output.
      
      commit a732e80d was the source of this
      regression.
      18938c29
  3. 22 4月, 2015 13 次提交
  4. 20 4月, 2015 5 次提交
    • R
      add optional global visibility override · de2b67f8
      Rich Felker 提交于
      this is implemented via the build system and does not affect source
      files. the idea is to use protected or hidden visibility to prevent
      the compiler from pessimizing function calls within a shared (or
      position-independent static) libc in the form of overhead setting up
      for a call through the PLT. the ld-time symbol binding via the
      -Bsymbolic-functions option already optimized out the PLT itself, but
      not the code in the caller needed to support a call through the PLT.
      on some archs this overhead can be substantial; on others it's
      trivial.
      de2b67f8
    • R
      remove invalid PLT calls from or1k asm · 51fc77c7
      Rich Felker 提交于
      analogous to commit 646cb9a4 for sh.
      51fc77c7
    • R
      remove possible-textrels from powerpc asm · cf1a9d9d
      Rich Felker 提交于
      these are perfectly fine with ld-time symbol binding, but otherwise
      result in textrels. they cannot be replaced with @PLT jump targets
      because the PLT thunks require a GOT register to be setup, so use a
      hidden alias instead.
      cf1a9d9d
    • R
      remove invalid PLT calls from microblaze asm · a880e6ce
      Rich Felker 提交于
      analogous to commit 646cb9a4 for sh.
      a880e6ce
    • R
      remove invalid PLT calls from sh asm · 646cb9a4
      Rich Felker 提交于
      these are perfectly fine with ld-time symbol binding, but if the calls
      go through a PLT thunk, they are invalid because the caller does not
      setup a GOT register. use a hidden alias to bypass the issue.
      646cb9a4
  5. 19 4月, 2015 4 次提交
  6. 18 4月, 2015 9 次提交
    • S
      math: fix pow(+-0,-inf) not to raise divbyzero flag · cb5c057c
      Szabolcs Nagy 提交于
      this reverts the commit f29fea00
      which was based on a bug in C99 and POSIX and did not match IEEE-754
      http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1515.pdf
      cb5c057c
    • R
      apply hidden visibility to tlsdesc accessor functions · 1b1cafa5
      Rich Felker 提交于
      these functions are never called directly; only their addresses are
      used, so PLT indirections should never happen unless a broken
      application tries to redefine them, but it's still best to make them
      hidden.
      1b1cafa5
    • S
      comment fixes in aarch64 tlsdesc asm · ca7977b5
      Szabolcs Nagy 提交于
      ca7977b5
    • R
      ensure debugger hook for dynamic linker does not point to a PLT slot · 326e126f
      Rich Felker 提交于
      this change is made in preparation to support linking without
      -Bsymbolic-functions.
      326e126f
    • R
      fix mips fesetenv(FE_DFL_ENV) again · 8b0d66d2
      Rich Felker 提交于
      commit 5fc14878 attempted to fix it,
      but neglected the fact that mips has branch delay slots.
      8b0d66d2
    • R
      fix PLT call offset in sh dlsym asm · aecdbb30
      Rich Felker 提交于
      the braf instruction's destination register is an offset from the
      address of the braf instruction plus 4 (or equivalently, the address
      of the next instruction after the delay slot). the code for dlsym was
      incorrectly computing the offset to pass using the address of the
      delay slot itself. in other places, a label was placed after the delay
      slot, but I find this confusing. putting the label on the branch
      instruction itself, and manually adding 4, makes it more clear which
      branch the offset in the constant pool goes with.
      aecdbb30
    • R
      fix sh build regressions in asm · 33615cd5
      Rich Felker 提交于
      even hidden functions need @PLT symbol references; otherwise an
      absolute address is produced instead of a PC-relative one.
      33615cd5
    • R
      fix sh __set_thread_area uninitialized return value · 64fbd15f
      Rich Felker 提交于
      this caused the dynamic linker/startup code to abort when r0 happened
      to contain a negative value.
      64fbd15f
    • R
      redesign sigsetjmp so that signal mask is restored after longjmp · 583e5512
      Rich Felker 提交于
      the conventional way to implement sigsetjmp is to save the signal mask
      then tail-call to setjmp; siglongjmp then restores the signal mask and
      calls longjmp. the problem with this approach is that a signal already
      pending, or arriving between unmasking of signals and restoration of
      the saved stack pointer, will have its signal handler run on the stack
      that was active before siglongjmp was called. this can lead to
      unbounded stack usage when siglongjmp is used to leave a signal
      handler.
      
      in the new design, sigsetjmp saves its own return address inside the
      extended part of the sigjmp_buf (outside the __jmp_buf part used by
      setjmp) then calls setjmp to save a jmp_buf inside its own execution.
      it then tail-calls to __sigsetjmp_tail, which uses the return value of
      setjmp to determine whether to save the current signal mask or restore
      a previously-saved mask.
      
      as an added bonus, this design makes it so that siglongjmp and longjmp
      are identical. this is useful because the __longjmp_chk function we
      need to add for ABI-compatibility assumes siglongjmp and longjmp are
      the same, but for different reasons -- it was designed assuming either
      can access a flag just past the __jmp_buf indicating whether the
      signal masked was saved, and act on that flag. however, early versions
      of musl did not have space past the __jmp_buf for the non-sigjmp_buf
      version of jmp_buf, so our setjmp cannot store such a flag without
      risking clobbering memory on (very) old binaries.
      583e5512
  7. 15 4月, 2015 3 次提交
    • R
      use hidden __tls_get_new for tls/tlsdesc lookup fallback cases · 81e18eb3
      Rich Felker 提交于
      previously, the dynamic tlsdesc lookup functions and the i386
      special-ABI ___tls_get_addr (3 underscores) function called
      __tls_get_addr when the slot they wanted was not already setup;
      __tls_get_addr would then in turn also see that it's not setup and
      call __tls_get_new.
      
      calling __tls_get_new directly is both more efficient and avoids the
      issue of calling a non-hidden (public API/ABI) function from asm.
      
      for the special i386 function, a weak reference to __tls_get_new is
      used since this function is not defined when static linking (the code
      path that needs it is unreachable in static-linked programs).
      81e18eb3
    • R
      cleanup use of visibility attributes in pthread_cancel.c · 9c738dc1
      Rich Felker 提交于
      applying the attribute to a weak_alias macro was a hack. instead use a
      separate declaration to apply the visibility, and consolidate
      declarations together to avoid having visibility mess all over the
      file.
      9c738dc1
    • R
      7405cd1e
  8. 14 4月, 2015 4 次提交