1. 19 Dec, 2013 1 commit
    • Nick Kralevich's avatar
      Clean up more recursive FORTIFY_SOURCE calls · e4c6b08c
      Nick Kralevich authored
      Don't use FORTIFY_SOURCE on functions which implement
      FORTIFY_SOURCE, to avoid infinite recursion problems.
      
      The previous patch only addressed one of the problems.
      
      Bug: 12216860
      Change-Id: I6f30ae7cb5b481be9942add18182ea4839d348a6
      e4c6b08c
  2. 16 Oct, 2013 1 commit
  3. 15 Oct, 2013 1 commit
  4. 09 Oct, 2013 1 commit
    • Elliott Hughes's avatar
      Fix x86_64 build, clean up intermediate libraries. · eb847bc8
      Elliott Hughes authored
      The x86_64 build was failing because clone.S had a call to __thread_entry which
      was being added to a different intermediate .a on the way to making libc.so,
      and the linker couldn't guarantee statically that such a relocation would be
      possible.
      
        ld: error: out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(clone.o): requires dynamic R_X86_64_PC32 reloc against '__thread_entry' which may overflow at runtime; recompile with -fPIC
      
      This patch addresses that by ensuring that the caller and callee end up in the
      same intermediate .a. While I'm here, I've tried to clean up some of the mess
      that led to this situation too. In particular, this removes libc/private/ from
      the default include path (except for the DNS code), and splits out the DNS
      code into its own library (since it's a weird special case of upstream NetBSD
      code that's diverged so heavily it's unlikely ever to get back in sync).
      
      There's more cleanup of the DNS situation possible, but this is definitely a
      step in the right direction, and it's more than enough to get x86_64 building
      cleanly.
      
      Change-Id: I00425a7245b7a2573df16cc38798187d0729e7c4
      eb847bc8
  5. 04 Oct, 2013 2 commits
  6. 02 May, 2013 1 commit
  7. 15 Mar, 2013 1 commit
    • Elliott Hughes's avatar
      Clean up internal libc logging. · 8f2a5a0b
      Elliott Hughes authored
      We only need one logging API, and I prefer the one that does no
      allocation and is thus safe to use in any context.
      
      Also use O_CLOEXEC when opening the /dev/log files.
      
      Move everything logging-related into one header file.
      
      Change-Id: Ic1e3ea8e9b910dc29df351bff6c0aa4db26fbb58
      8f2a5a0b
  8. 04 Dec, 2012 1 commit
  9. 22 Oct, 2012 1 commit
  10. 02 Oct, 2012 1 commit
  11. 11 Jun, 2012 2 commits
  12. 05 Jun, 2012 1 commit
    • Nick Kralevich's avatar
      libc: implement some FORTIFY_SOURCE functions · 0a230159
      Nick Kralevich authored
      Add initial support for -D_FORTIFY_SOURCE to bionic for the
      following functions:
      
      * memcpy
      * memmove
      * strcpy
      * strcat
      * strncpy
      * strncat
      
      This change adds a new version of the above functions which passes
      the size of the destination buffer to __builtin___*_chk.
      
      If the compiler can determine, at compile time, that the destination
      buffer is large enough, or the destination buffer can point to an object
      of unknown size, then the check call is bypassed.
      
      If the compiler can't make a compile time decision, then it calls
      the __*_chk() function, which does a runtime buffer size check
      
      These options are only enabled if the code is compiled with
      -D_FORTIFY_SOURCE=1 or 2, and only when optimizations are enabled.
      
      Please see
      * http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
      * http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
      
      for additional details on FORTIFY_SOURCE.
      
      Testing: Compiled the entire Android tree with -D_FORTIFY_SOURCE=1,
      and verified that everything appears to be working properly.
      Also created a test buffer overflow, and verified that it was
      caught by this change.
      
      Change-Id: I4fddb445bafe92b16845b22458d72e6dedd24fbc
      0a230159
  13. 08 May, 2012 1 commit
    • Ben Cheng's avatar
      Implement the "abort" stub in assembly for ARM. · eda7be45
      Ben Cheng authored
      So that we can always get the full stack trace regardless of gcc's handling
      of the "noreturn" attribute associated with abort().
      
      (Cherry pick of Id264a5167e7cabbf11515fbc48f5469c527e34d4.)
      
      Bug: 6455193
      
      Conflicts:
      
      	libc/Android.mk
      
      Change-Id: I568fc5303fd1d747075ca933355f914122f94dac
      eda7be45
  14. 04 Mar, 2009 2 commits
  15. 21 Oct, 2008 1 commit