1. 27 1月, 2016 4 次提交
    • S
      update netpacket/packet.h to linux v4.3 · 3934f49c
      Szabolcs Nagy 提交于
      3934f49c
    • S
      add new membarrier, userfaultfd and switch_endian syscalls · 09001a8f
      Szabolcs Nagy 提交于
      new in linux v4.3 added for aarch64, arm, i386, mips, or1k, powerpc,
      x32 and x86_64.
      
      membarrier is a system wide memory barrier, moves most of the
      synchronization cost to one side, new in kernel commit
      5b25b13ab08f616efd566347d809b4ece54570d1
      
      userfaultfd is useful for qemu and is new in kernel commit
      8d2afd96c20316d112e04d935d9e09150e988397
      
      switch_endian is powerpc only for switching endianness, new in commit
      529d235a0e190ded1d21ccc80a73e625ebcad09b
      09001a8f
    • S
      add new i386 socket syscall numbers · 37bfb68f
      Szabolcs Nagy 提交于
      new in linux v4.3 commit 9dea5dc921b5f4045a18c63eb92e84dc274d17eb
      direct calls instead of socketcall allow better seccomp filtering.
      
      musl continues to use socketcalls internally on i386. (older kernels
      would need a fallback mechanism if the direct calls were used.)
      37bfb68f
    • S
      change the internal socketcall selection logic · a5e133bf
      Szabolcs Nagy 提交于
      only use SYS_socketcall if SYSCALL_USE_SOCKETCALL is defined
      internally, otherwise use direct syscalls.
      
      this commit does not change the current behaviour, it is
      preparation for adding direct syscall numbers for i386.
      a5e133bf
  2. 26 1月, 2016 12 次提交
    • R
      add ssp suppression to some arch-override files that may need it · f9b8df46
      Rich Felker 提交于
      these were not covered by the parent-level rules with the new build
      system. in the old build system, the equivalent files were often in
      arch/$(ARCH)/src and likewise lacked the suppression. this could lead
      to early crashing (before thread pointer init) when libc itself was
      built with stack protector enabled.
      f9b8df46
    • R
      use same object files for libc.a and libc.so if compiler produces PIC · 1619127c
      Rich Felker 提交于
      now that .lo and .o files differ only by whether -fPIC is passed (and
      no longer at the source level based on the SHARED macro), it's
      possible to use the same object files for both static and shared libc
      when the compiler would produce PIC for the static files anyway. this
      happens if the user has included -fPIC in their CFLAGS or if the
      compiler has been configured to produce PIE by default.
      
      we use the .lo files for both, and still append -fPIC to the CFLAGS,
      rather than using the .o files so that libc.so does not break
      catastrophically if the user later removes -fPIC from CFLAGS in
      config.mak or on the make command line. this also ensures that we get
      full -fPIC in case -fpic, -fPIE, or some other lesser-PIC option was
      passed in CFLAGS.
      1619127c
    • R
      move dynamic linker to its own top-level directory, ldso · 5552ce52
      Rich Felker 提交于
      this eliminates the last need for the SHARED macro to control how
      files in the src tree are compiled. the same code is used for both
      libc.a and libc.so, with additional code for the dynamic linker (from
      the new ldso tree) being added to libc.so but not libc.a. separate .o
      and .lo object files still exist for the src tree, but the only
      difference is that the .lo files are built as PIC.
      
      in the future, if/when we add dlopen support for static-linked
      programs, much of the code in dynlink.c may be moved back into the src
      tree, but properly factored into separate source files. in that case,
      the code in the ldso tree will be reduced to just the dynamic linker
      entry point, self-relocation, and loading of libraries needed by the
      main application.
      5552ce52
    • R
      adapt static dl_iterate_phdr not to depend on !defined(SHARED) · 16f70388
      Rich Felker 提交于
      like elsewhere, use a weak alias that the dynamic linker will override
      with a more complete version capable of handling shared libraries.
      16f70388
    • R
      move static-linked stub dlsym out of dynlink.c · 4058795d
      Rich Felker 提交于
      the function name is still __-prefixed because it requires an asm
      wrapper to pass the caller's address in order for RTLD_NEXT to work.
      
      since this was the last function in dynlink.c still used for static
      linking, now the whole file is conditional on SHARED being defined.
      4058795d
    • R
      move static-linked stub dlopen out of dynlink.c · 14469371
      Rich Felker 提交于
      14469371
    • R
      move dlinfo out of dynlink.c · b9841473
      Rich Felker 提交于
      b9841473
    • R
      move dlclose out of dynlink.c to its own source file · da1fe7f5
      Rich Felker 提交于
      da1fe7f5
    • R
    • R
      move static/stub version of dladdr out of dynlink.c · 4f8f0380
      Rich Felker 提交于
      4f8f0380
    • R
      factor dlerror and error-setting code out of dynlink.c · a4fbc82c
      Rich Felker 提交于
      the ultimate goal of this change is to get all code used in libc.a out
      of dynlink.c, so that the dynamic linker code can be moved to its own
      tree and object files in the src tree can all be shared between libc.a
      and libc.so.
      a4fbc82c
    • R
      fix arm a_crash for big endian · e7a11189
      Rich Felker 提交于
      contrary to commit 89e149d2, big
      endian arm does need the instruction bytes in big endian order. rather
      than trying to use a special encoding that works as arm or thumb,
      simply encode the simplest/canonical undefined instructions dependent
      on whether __thumb__ is defined.
      e7a11189
  3. 25 1月, 2016 10 次提交
    • R
      add native a_crash primitive for arm · 89e149d2
      Rich Felker 提交于
      the .byte directive encodes a guaranteed-undefined instruction, the
      same one Linux fills the kuser helper page with when it's disabled.
      the udf mnemonic and and .insn directives are not supported by old
      binutils versions, and larger-than-byte integer directives would
      produce the wrong output on big-endian.
      89e149d2
    • S
      add new IP_BIND_ADDRESS_NO_PORT and IPPROTO_MPLS to netinet/in.h · 2c9acc51
      Szabolcs Nagy 提交于
      IP_BIND_ADDRESS_NO_PORT is a SOL_IP socket option to delay src port
      allocation until connect in case src ip is set with bind(port=0).
      new in linux v4.2, commit 90c337da1524863838658078ec34241f45d8394d
      
      IPPROTO_MPLS protocol number for mpls over ip.
      new in linux v4.2, commit 730fc4371333636a00fed32c587fc1e85c5367e2
      2c9acc51
    • S
      update netinet/tcp.h for linux v4.2 · 4da2d965
      Szabolcs Nagy 提交于
      TCP_CC_INFO is a new socket option to get congestion control info without
      netlink (union tcp_cc_info is in linux/inet_diag.h kernel header).
      linux commit 6e9250f59ef9efb932c84850cd221f22c2a03c4a
      
      TCP_SAVE_SYN, TCP_SAVED_SYN socket options are for saving and getting the
      SYN headers of passive connections in a server application.
      linux commit cd8ae85299d54155702a56811b2e035e63064d3d
      
      Add new tcpi_* fields to struct tcp_info implementing RFC4898 counters.
      linux commit 2efd055c53c06b7e89c167c98069bab9afce7e59
      4da2d965
    • S
      add MS_LAZYTIME mount option to sys/mount.h · ecf02f4e
      Szabolcs Nagy 提交于
      new in linux 4.0 commit 0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8,
      used to update atime/mtime/ctime only in memory when possible.
      ecf02f4e
    • S
      add AF_MPLS (PF_MPLS) address family to socket.h · 9f52c17e
      Szabolcs Nagy 提交于
      new in linux 4.0 commit 0189197f441602acdca3f97750d392a895b778fd.
      9f52c17e
    • S
      add MSG_FASTOPEN sendmsg/sendto flag to socket.h · ea4fc27d
      Szabolcs Nagy 提交于
      This was new in linux 3.5 in commit cf60af03ca4e71134206809ea892e49b92a88896,
      needed for tcp fastopen feature (sending data in TCP SYN packet).
      ea4fc27d
    • S
      clean powerpc syscall.h · bc443c3f
      Szabolcs Nagy 提交于
      remove ifdefs for powerpc64.
      bc443c3f
    • S
      add missing powerpc specific PROT_SAO memory protection flag · f9c3a2e0
      Szabolcs Nagy 提交于
      this flag for strong access ordering was added in linux v2.6.27
      commit aba46c5027cb59d98052231b36efcbbde9c77a1d
      f9c3a2e0
    • S
      fix powerpc MCL_* mlockall flags in bits/mman.h · 2f6f3dcc
      Szabolcs Nagy 提交于
      the definitions didn't match the linux uapi headers.
      2f6f3dcc
    • S
      fix aarch64 atomics to load/store 32bit only · 2d14fa39
      Szabolcs Nagy 提交于
      a_ll/a_sc inline asm used 64bit register operands (%0) instead of 32bit
      ones (%w0), this at least broke a_and_64 (which always cleared the top
      32bit, leaking memory in malloc).
      2d14fa39
  4. 24 1月, 2016 1 次提交
    • R
      improve aarch64 atomics · b17fbd35
      Rich Felker 提交于
      aarch64 provides ll/sc variants with acquire/release memory order,
      freeing us from the need to have full barriers both before and after
      the ll/sc operation. previously they were not used because the a_cas
      can fail without performing a_sc, in which case half of the barrier
      would be omitted. instead, define a custom version of a_cas for
      aarch64 which uses a_barrier explicitly when aborting the cas
      operation. aside from cas, other operations built on top of ll/sc are
      not affected since they never abort but rather loop until they
      succeed.
      
      a split ll/sc version of the pointer-sized a_cas_p is also introduced
      using the same technique.
      
      patch by Szabolcs Nagy.
      b17fbd35
  5. 22 1月, 2016 13 次提交