Commit graph

4240 commits

Author SHA1 Message Date
Dan Albert
2320b02c7d __gnu_basename(3) is accounted for.
Change-Id: I3836b14a797c4a8d121c6d29d95791ac768257da
2014-08-21 11:36:07 -07:00
Elliott Hughes
6b841db2ba Add POSIX-2008 fmemopen, open_memstream, and open_wmemstream.
Bug: 17164505
Change-Id: I59e28a08ff8b6ab632230b11a5807cfd5278aeb5
2014-08-20 17:03:46 -07:00
Elliott Hughes
0e7f8a9e52 Simplify _ALIGN_TEXT.
Bug: 16872067
Change-Id: I2b622f252c21ce1b344c040f828ab3f4bf9b6c0a
2014-08-20 13:11:58 -07:00
Elliott Hughes
c4a1de1ae2 Regenerate "services.h" from /etc/services.
Change-Id: Iec118f9a342b5c1f6ce6d48965798b12a7159ad3
2014-08-20 12:11:31 -07:00
Elliott Hughes
dc1fb7000a Clean up some of our python scripts.
Change-Id: Ifa75345db43434298cfb6113fbe2f7a33b88c79d
2014-08-20 11:16:11 -07:00
Elliott Hughes
2b021e1066 Add <stdio_ext.h> for elfutils.
Bug: 17139679
Change-Id: I1605ac382dbb6f23b2d874dbb9769f3cde4a6a99
2014-08-20 10:23:52 -07:00
Hans Boehm
b61c50647b Merge "Work around atomic_load(const T*) issues." 2014-08-19 22:32:42 +00:00
Hans Boehm
1e8587a479 Work around atomic_load(const T*) issues.
Bug:17067219
Change-Id: I78e753bcf03464f5f05c3f37e394f2727d282589
2014-08-19 14:50:54 -07:00
Elliott Hughes
35d226e05d Add in_port_t and move it and in_addr_t to the correct header file.
No one's reported this, but I saw it in an Android port of fuser(1).

We still have lots of problems in our network headers because we
get most of the structs direct from the kernel, and it doesn't use
types like this (which is why we've got away without this one for
so long). One day we should probably look at cleaning that up, but
doing so can wait.

Change-Id: If15edf0cfc32716fa312d7ed97c48321b760d979
2014-08-19 12:43:50 -07:00
Elliott Hughes
09c39d6df0 Implement the GNU basename(3) in addition to the POSIX one.
Code like perf(1) needs this.

Bug: 11860789
Change-Id: I907eb448052a7b165e4012d74303330d32328cb2
2014-08-19 14:30:30 -07:00
Elliott Hughes
6f4220c49e Merge "Move the meat of <features.h> into <sys/cdefs.h>." 2014-08-19 02:44:29 +00:00
Elliott Hughes
f4c948a9e9 Move the meat of <features.h> into <sys/cdefs.h>.
This way it's a lot harder for us to screw up (since we should always
be including <sys/cdefs.h> anyway).

Bug: 14659579
Change-Id: I23070fff3296b0d1c683bb5e3a6e214146327d53
2014-08-19 11:18:20 -07:00
Elliott Hughes
17f83c93cb Merge "Remove unused defines from <features.h>." 2014-08-19 02:44:29 +00:00
Elliott Hughes
f800969d35 Remove unused defines from <features.h>.
Bug: 14659579
Change-Id: I2ab02b13cafe3faad31248b843d39ab2cdbfeb91
2014-08-19 10:07:00 -07:00
Elliott Hughes
b810462028 Fix _BSD_SOURCE/__USE_BSD.
Bug: 14659579
Change-Id: I80ec9584f054c02d1078828f6bca759c42bc1d4c
2014-08-19 09:18:03 -07:00
Dan Albert
3a25ab952b Missing #include <sys/cdefs.h>.
Needed for __BEGIN_DECLS/__END_DECLS. Currently fine because it's being
included after other files that do this.

Change-Id: I1f12368fc461f6ef5ca90992cf19f317f0b5d7af
2014-08-19 11:08:02 -07:00
Dan Albert
934c8015d5 Merge "Expose android_set_abort_message()." 2014-08-16 04:20:19 +00:00
Dan Albert
ce6b1abbb1 Expose android_set_abort_message().
Removes the leading underscores from __android_set_abort_message() and
moves its declaration into a public header file.

Bug: 17059126
Change-Id: I470c79db47ec783ea7a54b800f8b78ecbe7479ab
2014-08-18 14:37:42 -07:00
Christopher Ferris
54d24e099c Merge "Fix leak_realloc, copy entire allocation." 2014-08-16 04:08:14 +00:00
Christopher Ferris
6d40d34908 Fix leak_realloc, copy entire allocation.
Bug: 16874447

(cherry picked from commit 5df0839cea)

Change-Id: I9280505c0c1c3b5da24ba590448dcd6e7a230406
2014-08-18 13:10:47 -07:00
Christopher Ferris
5d9e145c62 malloc_usable_size returns the original size.
Bug: 16874447

(cherry picked from commit 59c1ee44d0)

Change-Id: I70839632974367c8b9893fb1f9c5ee4364608470
2014-08-18 13:10:16 -07:00
Christopher Ferris
3c7c9a8d3f Merge "malloc_usable_size returns the original size." 2014-08-16 04:09:33 +00:00
Dan Albert
fd5ee9aebc Hide C++ stuff in libc. Put it back in libstdc++.
Bug: 17062445
Change-Id: I027b186719654c2865b08c3fa83f90fa00c1e838
2014-08-18 12:01:01 -07:00
Elliott Hughes
5f5cc45cf0 Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE).
<features.h> is supposed to take user-settable stuff like _GNU_SOURCE
and _BSD_SOURCE and turn them into __USE_GNU and __USE_BSD for use in
the C library headers. Instead, bionic used to unconditionally define
_BSD_SOURCE and _GNU_SOURCE, and then test _GNU_SOURCE in the header
files (which makes no sense whatsoever).

Bug: 14659579
Change-Id: Ice4cf21a364ea2e559071dc8329e995277d5b987
2014-08-18 16:04:03 -07:00
Elliott Hughes
205cc41556 Merge "Improve <sys/cdefs.h>." 2014-08-18 21:31:43 +00:00
Elliott Hughes
2cfb4e8e2e Improve <sys/cdefs.h>.
Fix and use __RENAME (and lose ___RENAME --- two underscores should be
enough for anybody). This was the point of this change, because I want
to use __RENAME to support the two basename variants and the two
strerror_r variants.

Lose a bunch of macros that weren't being used.

Lose three dead files from the DNS code.

Change-Id: I3ef645c566b16a52217bc2e68c7d54b37c7c9522
2014-08-18 14:45:42 -07:00
Hans Boehm
7d05f741e7 Merge "Have stdatomic.h punt to C++ atomic when possible" 2014-08-15 05:01:31 +00:00
Hans Boehm
019d395811 Have stdatomic.h punt to C++ atomic when possible
This is an alternate, somewhat simpler, fix that makes it safe to
include both <atomic> and <stdatomic.h> from C++ code in either order.
It means that C code consistently uses one implementation of atomics
and C++ another.  We still have to make sure that those two
implementations interoperate correctly at runtime; in particular,
any flavor of atomic object needs to be represented exactly like the
underlying type, with the proper alignment constraint.

Bug:17007799
Change-Id: Iffcfc5220d8fa150f89dd083a121b24d23f268fc
2014-08-15 10:38:20 -07:00
Dan Albert
891ec7a6e4 Move mtctxres.c to libc_dns.a.
Has the effect of making ___mtctxres hidden.

Bug: 17007799
Change-Id: I5aa5f49344ad5ecb33f48737430561b329bcbb0d
2014-08-14 22:50:45 +00:00
Dan Albert
0d4ccee351 Merge "Change name of MB_CUR_MAX implementation function." 2014-08-14 19:41:13 +00:00
Dan Albert
224ff048ef Change name of MB_CUR_MAX implementation function.
Glibc calls theirs __ctype_get_mb_cur_max. Make ours match to cut down
on differences between bionic and glibc.

Bug: 11156955
Change-Id: Ib7231f01aa9676dff30aea0af25d597bfe07bc73
2014-08-14 13:56:51 -07:00
Dan Albert
104a472958 Merge "Add more functionality to glibc symbol checker." 2014-08-14 19:41:13 +00:00
Dan Albert
76212eeb53 Add more functionality to glibc symbol checker.
Also scan NDK's unwanted symbols list (to show the things that we're
exporting but the NDK isn't. Symbols hidden in the NDK will be marked
with a *.

Add a -u (--unwanted) flag to disable the first two printed groups
(all symbols in bionic, all symbols in glibc). This is helpful when
wanting to grep in the list of unwanted symbols.

Finally, update the list of known differences between us and glibc.

Change-Id: I6fdb4126823098430454763c391bd8cd369a75bb
2014-08-14 14:02:34 -07:00
Dan Albert
9a74e4c15c Merge "Hide __libc_init_vdso()." 2014-08-12 23:11:16 +00:00
Dan Albert
b3aaf398e1 Hide __libc_init_vdso().
Bug: 11156955
Change-Id: I7ee31e1ee2ce479c5746b374a239637d582815fe
2014-08-13 13:11:58 -07:00
Hans Boehm
4f85c6ffd3 Merge "Add memory ordering constraint, convert to C11 atomics" 2014-08-12 19:23:43 +00:00
Dan Albert
f2c1e7ee78 Hide ScopedTrace.
Bug: 11156955
Change-Id: I6cddc868d1c6503e30f1ffcf460f45670631d64a
2014-08-13 11:25:01 -07:00
Dan Albert
edd81faff0 Hide __libc_malloc_dispatch.
Now that -Bsymbolic is fixed, we can hide __libc_malloc_dispatch without
breaking ASAN.

Bug: 11156955
Change-Id: Ia2fc9b046a74e666b33aa6c6c5435f70a63b8021
2014-08-12 16:53:14 -07:00
Dmitriy Ivanov
e942b3ed81 Merge "Added test for ifunc support in dynamic linker." 2014-08-12 19:23:43 +00:00
Dmitriy Ivanov
00c16c1b92 Merge "Label pages mapped by linker_allocator" 2014-08-09 00:45:41 +00:00
Dmitriy Ivanov
51a22a12ab Label pages mapped by linker_allocator
Change-Id: I7e0bf29bc1a480e9be0d1ae573ca1063d90d82ff
2014-08-11 09:22:48 -07:00
Elliott Hughes
ca5b6a74a7 Fix our x86 PIC_PROLOGUE.
The old definition only worked for functions that didn't use numbered
local labels. Upstream uses '666' not only as some kind of BSD in-joke,
but also because there's little likelihood of any function having
labels that high.

There's a wider question about whether we actually want to go via the
PLT at all in this code, but that's a question for another day.

(cherry-pick of 72d7e667c7e926cb120c4edb53cbf74c652ab915.)

Bug: 16906712
Change-Id: I3cd8ecc448b33f942bb6e783931808ef39091489
2014-08-09 22:18:33 -07:00
Hans Boehm
30214b901e Add memory ordering constraint, convert to C11 atomics
Add an ordering constraint/fence to __system_property_serial.
This slows down a read on a Nexus 5 from about 50 to about 70 ns,
but avoids the possibility of seeing an inconsistent property value.
Use C11 atomic operations where easy and appropriate.
This code remains not fully C++11 memory model conformant, but
I would now expect the generated code to now be correct with current compilers.

Bug:14970171
Change-Id: I0891ff1d0f914ae5c3857e3d76b6a7c8a4a07d83
2014-08-08 11:34:25 -07:00
Brigid Smith
c5a13efa9b Added test for ifunc support in dynamic linker.
ifuncs now work in i386 and x86_64 when called in the same library as
well as in a different library.

Bug:6657325
Change-Id: Ic0c48b1b0a76cb90f36c20c79f68294cc3fd44a1
2014-08-08 11:29:35 -07:00
Dan Albert
bc9f9f25bf Make __set_errno hidden in asm.
This fixes the build after the -Bsymbolic change.

Bug: 16853291
Change-Id: I989c9fec3c32e0289ea257a3bd2b7fd2709b6ce2
2014-08-08 15:35:47 -07:00
Dan Albert
3726f9c38b Revert "Fix incorrect relocations for x86."
Bug: 16853291
This reverts commit 512bc52326.
2014-08-08 22:26:47 +00:00
Christopher Ferris
88a1f520d2 Add a way to disable backtracing in malloc debug.
The property libc.debug.malloc.nobacktrace set to non-zero disables
getting backtracing when using mode 1 or mode 10.

Bug: 16874447

(cherry picked from 49de01a5be)

Change-Id: I6bbefe5420b14991fe84c2f849222dcd7cb592bf
2014-08-08 09:40:17 -07:00
Elliott Hughes
f2d8c357ee Merge "Remove misleading arm/arm64 PIC_SYM." 2014-08-06 23:49:29 +00:00
Elliott Hughes
651a0683ca Remove misleading arm/arm64 PIC_SYM.
Bug: 16823325
Change-Id: Ic8ff3a628bb4cd71361e3a1c2cfde4b3d39c50b1
2014-08-07 11:52:38 -07:00
Christopher Ferris
92f0c91b82 Merge "Create a distinct temp directory for each run." 2014-08-07 15:46:11 +00:00