OSDN Git Service

android-x86/bionic.git
11 years agobionic: use the size of the file to determine property area size
Colin Cross [Tue, 25 Jun 2013 01:42:21 +0000 (18:42 -0700)]
bionic: use the size of the file to determine property area size

On the reader size, don't assume that the property size is PA_SIZE,
read it from the size of the file.  Allows init to use a different
property size without recompiling statically linked executables.

Change-Id: I87fb0bf40c4724e3759a583fd9ea1f49492bc958

11 years agobionic: store property names as variable-length strings
Greg Hackmann [Fri, 21 Jun 2013 20:02:38 +0000 (13:02 -0700)]
bionic: store property names as variable-length strings

Names are immutable, so the fixed-sized arrays can be replaced with
variable-length ones to save memory (especially on internal tree nodes).

Change-Id: Iddf7856fba579b97f355e9ad4b3663a78767b96d
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agobionic: prevent root processes from calling __system_property_add
Colin Cross [Sun, 16 Jun 2013 17:19:16 +0000 (10:19 -0700)]
bionic: prevent root processes from calling __system_property_add

If a root process other than init calls __system_property_add, which
it should never do, it will break the design assumption that there is
only one mutator.

Pass O_EXCL to open() in map_prop_region_rw to ensure that only one
process ever has the property pages open for write.

Change-Id: I8233bfe0beaa40a5003ad53b98c661536b15f6b7

11 years agobionic: revert to a single (larger) property area
Greg Hackmann [Wed, 19 Jun 2013 20:31:21 +0000 (13:31 -0700)]
bionic: revert to a single (larger) property area

d329697 is too complicated.  Change the multiple property pages back to
a single 128K property area that's mapped in entirely at initialization
(the memory will not get allocated until the pages are touched).

d329697 has other changes useful for testing (moving property area
initialization inside bionic and adding __system_property_set_filename)
so undo the change manually rather than with git revert.

Change-Id: Icd137669a4f8bc248e9dd2c1e8cc54e9193c9a6d
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agobionic: add hierarchical properties test
Greg Hackmann [Mon, 17 Jun 2013 19:37:09 +0000 (12:37 -0700)]
bionic: add hierarchical properties test

Deliberately put items several levels deep in the trie hierarchy to test
the trie traversal

Change-Id: I995a1cdd3b5e74162fb5d25bc0f65140bdf2f719
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agobionic: reimplement property area as hybrid trie/binary tree
Greg Hackmann [Thu, 20 Jun 2013 18:27:56 +0000 (11:27 -0700)]
bionic: reimplement property area as hybrid trie/binary tree

See the comments for an explanation of how properties are stored.

The trie structure is designed to scale better than the previous
array-based implementation.  Searching an array with n properties
required average O(n) string compares of the entire key; searching the
trie requires average O(log n) string compares of each token (substrings
between '.' characters).

Change-Id: Ic28b3c5246004a3c502eb02d6e1c9b512884d872
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agoam 95448039: am 0ea1d5c0: Merge "libc: enable sprintf FORTIFY_SOURCE under clang"
Nick Kralevich [Tue, 25 Jun 2013 12:59:32 +0000 (05:59 -0700)]
am 95448039: am 0ea1d5c0: Merge "libc: enable sprintf FORTIFY_SOURCE under clang"

* commit '954480393f4539f62cdc3f6cb83c562050ea4f51':
  libc: enable sprintf FORTIFY_SOURCE under clang

11 years agobionic: replace 4K property pages with 32K property pages
Greg Hackmann [Tue, 25 Jun 2013 01:41:46 +0000 (18:41 -0700)]
bionic: replace 4K property pages with 32K property pages

Fixes apps compiled statically against new libc but running with old
init

Bug: 9558625
Change-Id: I79e6f02575d278d4c7d8e8546d772ed0529bcaab
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agoRevert "bionic: reimplement property area as hybrid trie/binary tree"
Greg Hackmann [Tue, 25 Jun 2013 01:05:20 +0000 (18:05 -0700)]
Revert "bionic: reimplement property area as hybrid trie/binary tree"

This reverts commit 6ac8e6a46d71a51bec16938efa89f275fa89cf7d.

11 years agoRevert "bionic: add hierarchical properties test"
Greg Hackmann [Tue, 25 Jun 2013 01:05:18 +0000 (18:05 -0700)]
Revert "bionic: add hierarchical properties test"

This reverts commit 0f76e2340ca53ce458a01f91627651dfe0112969.

11 years agoRevert "bionic: revert to a single (larger) property area"
Greg Hackmann [Tue, 25 Jun 2013 01:05:16 +0000 (18:05 -0700)]
Revert "bionic: revert to a single (larger) property area"

This reverts commit 5f05348c18286a2cea46eae8acf94ed5b7932fac.

11 years agoRevert "bionic: prevent root processes from calling __system_property_add"
Greg Hackmann [Tue, 25 Jun 2013 01:05:14 +0000 (18:05 -0700)]
Revert "bionic: prevent root processes from calling __system_property_add"

This reverts commit fb9b7b436f3ef94385f1b0c55ab81f246f0d96b8.

11 years agoRevert "bionic: store property names as variable-length strings"
Greg Hackmann [Tue, 25 Jun 2013 01:05:10 +0000 (18:05 -0700)]
Revert "bionic: store property names as variable-length strings"

This reverts commit 492ce95d9f6149137cb5b63c55cf2b3cdbe51e5e.

11 years agobionic: store property names as variable-length strings
Greg Hackmann [Fri, 21 Jun 2013 20:02:38 +0000 (13:02 -0700)]
bionic: store property names as variable-length strings

Names are immutable, so the fixed-sized arrays can be replaced with
variable-length ones to save memory (especially on internal tree nodes).

Change-Id: Iee77874b4b55b0f9c5e531d1334be7f7f40086d2
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agobionic: prevent root processes from calling __system_property_add
Colin Cross [Sun, 16 Jun 2013 17:19:16 +0000 (10:19 -0700)]
bionic: prevent root processes from calling __system_property_add

If a root process other than init calls __system_property_add, which
it should never do, it will break the design assumption that there is
only one mutator.

Pass O_EXCL to open() in map_prop_region_rw to ensure that only one
process ever has the property pages open for write.

Change-Id: I6b7c118e5e2fd2b92a2b168b8454fe9707325462

11 years agobionic: revert to a single (larger) property area
Greg Hackmann [Wed, 19 Jun 2013 20:31:21 +0000 (13:31 -0700)]
bionic: revert to a single (larger) property area

d329697 is too complicated.  Change the multiple property pages back to
a single 128K property area that's mapped in entirely at initialization
(the memory will not get allocated until the pages are touched).

d329697 has other changes useful for testing (moving property area
initialization inside bionic and adding __system_property_set_filename)
so undo the change manually rather than with git revert.

Change-Id: I0ecb27843404f93af5489f15bfe657d65175e4f0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agoam 0ea1d5c0: Merge "libc: enable sprintf FORTIFY_SOURCE under clang"
Nick Kralevich [Mon, 24 Jun 2013 22:20:39 +0000 (15:20 -0700)]
am 0ea1d5c0: Merge "libc: enable sprintf FORTIFY_SOURCE under clang"

* commit '0ea1d5c0ae94ee581c72451b20813c028f51090c':
  libc: enable sprintf FORTIFY_SOURCE under clang

11 years agoMerge "libc: enable sprintf FORTIFY_SOURCE under clang"
Nick Kralevich [Mon, 24 Jun 2013 22:15:12 +0000 (22:15 +0000)]
Merge "libc: enable sprintf FORTIFY_SOURCE under clang"

11 years agolibc: enable sprintf FORTIFY_SOURCE under clang
Nick Kralevich [Mon, 24 Jun 2013 18:44:00 +0000 (11:44 -0700)]
libc: enable sprintf FORTIFY_SOURCE under clang

clang doesn't support __builtin_va_arg_pack(), so we have
to use #define instead.

Change-Id: I2ee75e6267d60cdf997fee6b9b0547bf68f062a1

11 years agobionic: add hierarchical properties test
Greg Hackmann [Mon, 17 Jun 2013 19:37:09 +0000 (12:37 -0700)]
bionic: add hierarchical properties test

Deliberately put items several levels deep in the trie hierarchy to test
the trie traversal

Change-Id: Id3cbd2e7d3500216b1ac8025eac70c0939622903
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agobionic: reimplement property area as hybrid trie/binary tree
Greg Hackmann [Thu, 20 Jun 2013 18:27:56 +0000 (11:27 -0700)]
bionic: reimplement property area as hybrid trie/binary tree

See the comments for an explanation of how properties are stored.

The trie structure is designed to scale better than the previous
array-based implementation.  Searching an array with n properties
required average O(n) string compares of the entire key; searching the
trie requires average O(log n) string compares of each token (substrings
between '.' characters).

Change-Id: I491305bc7aca59609abcd871a5f33d97f89ce714
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agoMerge "bionic: add missing memory barriers to system properties"
Greg Hackmann [Mon, 24 Jun 2013 17:15:43 +0000 (17:15 +0000)]
Merge "bionic: add missing memory barriers to system properties"

11 years agoam 100d6784: am 53ddcc90: Merge "linker: Emit a warning on text relocations"
Nick Kralevich [Fri, 21 Jun 2013 23:01:02 +0000 (16:01 -0700)]
am 100d6784: am 53ddcc90: Merge "linker: Emit a warning on text relocations"

* commit '100d678438f222ad6ef8f3dc0646911b218c50a9':
  linker: Emit a warning on text relocations

11 years agoam 53ddcc90: Merge "linker: Emit a warning on text relocations"
Nick Kralevich [Fri, 21 Jun 2013 22:39:21 +0000 (15:39 -0700)]
am 53ddcc90: Merge "linker: Emit a warning on text relocations"

* commit '53ddcc90701d86c7d809a84cf4710c651066e3c7':
  linker: Emit a warning on text relocations

11 years agoMerge "linker: Emit a warning on text relocations"
Nick Kralevich [Fri, 21 Jun 2013 22:36:50 +0000 (22:36 +0000)]
Merge "linker: Emit a warning on text relocations"

11 years agolinker: Emit a warning on text relocations
Nick Kralevich [Fri, 21 Jun 2013 19:31:33 +0000 (12:31 -0700)]
linker: Emit a warning on text relocations

Text relocations unnecessarily mark pages as dirty, preventing them
from being swapped out, wasting memory. Also, text relocations
prevent the code from running on certain hardened systems.

Print a message in logcat and stderr when we see a text relocation,
to encourage developers to fix their code.

Change-Id: I6051a7463911e090ae5727a355397d539669d5b9

11 years agoam cb25359a: am 68197731: Merge "libc_logging: don\'t keep file descriptors open...
Nick Kralevich [Fri, 21 Jun 2013 22:15:22 +0000 (15:15 -0700)]
am cb25359a: am 68197731: Merge "libc_logging: don\'t keep file descriptors open forever"

* commit 'cb25359a2e20489a3a9f65795a2079abc8fe0b65':
  libc_logging: don't keep file descriptors open forever

11 years agoam 68197731: Merge "libc_logging: don\'t keep file descriptors open forever"
Nick Kralevich [Fri, 21 Jun 2013 21:33:48 +0000 (14:33 -0700)]
am 68197731: Merge "libc_logging: don\'t keep file descriptors open forever"

* commit '6819773103495a6fd81f024dc6711771320ae4ec':
  libc_logging: don't keep file descriptors open forever

11 years agoMerge "libc_logging: don't keep file descriptors open forever"
Nick Kralevich [Fri, 21 Jun 2013 21:26:09 +0000 (21:26 +0000)]
Merge "libc_logging: don't keep file descriptors open forever"

11 years agolibc_logging: don't keep file descriptors open forever
Nick Kralevich [Fri, 21 Jun 2013 20:28:42 +0000 (13:28 -0700)]
libc_logging: don't keep file descriptors open forever

Avoid keeping unnecessary file descriptors around when they're not
needed. Libc doesn't log so much that opening / closing overhead
matters.

Change-Id: I590ec5c27562db9bac025f781c48ec9a7724ce77

11 years agobionic: add missing memory barriers to system properties
Greg Hackmann [Thu, 20 Jun 2013 17:33:28 +0000 (10:33 -0700)]
bionic: add missing memory barriers to system properties

1) Reading the value must finish before checking whether it's intact

2) Setting the serial's dirty bit must visible before modifying the
value

3) The modified value must be visible before clearing the serial's dirty
bit

4) New properties and their TOC entries must be visible before updating
the property count

Change-Id: I26c680ec025fdb72362d5f618ec0d2b93d381233
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agoam 5fed0eea: am 0ce28d20: Merge "libc: enable FORTIFY_SOURCE clang strlcpy"
Nick Kralevich [Thu, 20 Jun 2013 19:34:11 +0000 (12:34 -0700)]
am 5fed0eea: am 0ce28d20: Merge "libc: enable FORTIFY_SOURCE clang strlcpy"

* commit '5fed0eeabd88bfe241c416f2c2f44a14b6e447fa':
  libc: enable FORTIFY_SOURCE clang strlcpy

11 years agoam 0ce28d20: Merge "libc: enable FORTIFY_SOURCE clang strlcpy"
Nick Kralevich [Thu, 20 Jun 2013 19:29:38 +0000 (12:29 -0700)]
am 0ce28d20: Merge "libc: enable FORTIFY_SOURCE clang strlcpy"

* commit '0ce28d20ea5fde250576f355004dbcd741b0b884':
  libc: enable FORTIFY_SOURCE clang strlcpy

11 years agoMerge "libc: enable FORTIFY_SOURCE clang strlcpy"
Nick Kralevich [Thu, 20 Jun 2013 19:27:47 +0000 (19:27 +0000)]
Merge "libc: enable FORTIFY_SOURCE clang strlcpy"

11 years agolibc: enable FORTIFY_SOURCE clang strlcpy
Nick Kralevich [Thu, 20 Jun 2013 19:17:44 +0000 (12:17 -0700)]
libc: enable FORTIFY_SOURCE clang strlcpy

Change-Id: Idcfe08f5afc3dde592416df9eba83f64e130c7c2

11 years agoam 33df38a0: am 4eed6509: Merge "stdint.h header is not fully compatible with C99...
Elliott Hughes [Wed, 19 Jun 2013 19:57:39 +0000 (12:57 -0700)]
am 33df38a0: am 4eed6509: Merge "stdint.h header is not fully compatible with C99(ISO9899:1999)"

* commit '33df38a04c31de0fca431c549469edb6d2de75e2':
  stdint.h header is not fully compatible with C99(ISO9899:1999)

11 years agoam 4eed6509: Merge "stdint.h header is not fully compatible with C99(ISO9899:1999)"
Elliott Hughes [Wed, 19 Jun 2013 19:46:40 +0000 (12:46 -0700)]
am 4eed6509: Merge "stdint.h header is not fully compatible with C99(ISO9899:1999)"

* commit '4eed65090b1f0d0d087f26bd7367da90a0cca92d':
  stdint.h header is not fully compatible with C99(ISO9899:1999)

11 years agoMerge "stdint.h header is not fully compatible with C99(ISO9899:1999)"
Elliott Hughes [Wed, 19 Jun 2013 19:45:09 +0000 (19:45 +0000)]
Merge "stdint.h header is not fully compatible with C99(ISO9899:1999)"

11 years agobionic: make property area expandable
Greg Hackmann [Wed, 13 Feb 2013 22:41:48 +0000 (14:41 -0800)]
bionic: make property area expandable

The property area is initially one 4K region, automatically expanding as
needed up to 64 regions.

To avoid duplicating code, __system_property_area_init() now allocates
and initializes the first region (previously it was allocated in init's
init_property_area() and initialized in bionic).  For testing purposes,
__system_property_set_filename() may be used to override the file used
to map in regions.

Change-Id: Ibe00ef52464bfa590953c4699a6d98383b0142b1
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agoam 1d174a9c: am 02ca0e31: Merge "Fix FORTIFY_SOURCE unittests."
Nick Kralevich [Wed, 19 Jun 2013 17:40:46 +0000 (10:40 -0700)]
am 1d174a9c: am 02ca0e31: Merge "Fix FORTIFY_SOURCE unittests."

* commit '1d174a9c17f645a27d766a66e7477d797f955e90':
  Fix FORTIFY_SOURCE unittests.

11 years agoam 02ca0e31: Merge "Fix FORTIFY_SOURCE unittests."
Nick Kralevich [Wed, 19 Jun 2013 17:36:55 +0000 (10:36 -0700)]
am 02ca0e31: Merge "Fix FORTIFY_SOURCE unittests."

* commit '02ca0e314219a4c7205a180a414c509651043f13':
  Fix FORTIFY_SOURCE unittests.

11 years agoMerge "Fix FORTIFY_SOURCE unittests."
Nick Kralevich [Wed, 19 Jun 2013 17:33:57 +0000 (17:33 +0000)]
Merge "Fix FORTIFY_SOURCE unittests."

11 years agoam f4250508: am 3225f498: Merge "bionic: add __system_property_foreach"
Colin Cross [Wed, 19 Jun 2013 17:31:11 +0000 (10:31 -0700)]
am f4250508: am 3225f498: Merge "bionic: add __system_property_foreach"

* commit 'f4250508d5de415e200888ffdf143f870dc0f829':
  bionic: add __system_property_foreach

11 years agoam 3225f498: Merge "bionic: add __system_property_foreach"
Colin Cross [Wed, 19 Jun 2013 17:27:23 +0000 (10:27 -0700)]
am 3225f498: Merge "bionic: add __system_property_foreach"

* commit '3225f4984837c4d9e6e9495d2154f2d9987cf457':
  bionic: add __system_property_foreach

11 years agoMerge "bionic: add __system_property_foreach"
Colin Cross [Wed, 19 Jun 2013 17:26:17 +0000 (17:26 +0000)]
Merge "bionic: add __system_property_foreach"

11 years agoFix FORTIFY_SOURCE unittests.
Nick Kralevich [Wed, 19 Jun 2013 17:25:44 +0000 (10:25 -0700)]
Fix FORTIFY_SOURCE unittests.

The compiler is too damn smart.

Change-Id: Ibef3ef41ec99f8cd9c06f1dbca535819f9a08197

11 years agostdint.h header is not fully compatible with C99(ISO9899:1999)
Sergey Melnikov [Thu, 22 Nov 2012 11:23:48 +0000 (15:23 +0400)]
stdint.h header is not fully compatible with C99(ISO9899:1999)

stdint.h provides macros with incorrect type:
  * UINT8_C
  * UINT16_C
  * UINT8_MAX
  * UINT16_MAX

Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
Change-Id: I2d130c782d4485bf6c9e9f068de0bdaa4ba7303f

11 years agobionic: add __system_property_foreach
Greg Hackmann [Wed, 13 Feb 2013 00:39:31 +0000 (16:39 -0800)]
bionic: add __system_property_foreach

find_nth() will be inefficient on a trie.  Since find_nth() is only used
internally and only for enumerating properties, we can add a foreach()
function to do this directly.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
(cherry picked from commit 577418403d68e663fb33c7b0c8a90d862d9c00cf)

Change-Id: Iaca97d1182ce2c28863ba85241cbb5cf6185eb2f

11 years agobionic: add __system_property_foreach
Greg Hackmann [Wed, 13 Feb 2013 00:39:31 +0000 (16:39 -0800)]
bionic: add __system_property_foreach

find_nth() will be inefficient on a trie.  Since find_nth() is only used
internally and only for enumerating properties, we can add a foreach()
function to do this directly.

Change-Id: I66bde9926c193073d74b244cce9fffd52108fff8
Signed-off-by: Greg Hackmann <ghackmann@google.com>
11 years agoMerge "Fix remove_uidiface_info failing on first entry"
Geremy Condra [Tue, 18 Jun 2013 21:43:52 +0000 (21:43 +0000)]
Merge "Fix remove_uidiface_info failing on first entry"

11 years agoam 13e23302: am c656d732: Merge "Always use v1 for MIPS TLS access."
Elliott Hughes [Tue, 18 Jun 2013 21:00:59 +0000 (14:00 -0700)]
am 13e23302: am c656d732: Merge "Always use v1 for MIPS TLS access."

* commit '13e23302c93fdd8b52c606277f32dec0627ddbbd':
  Always use v1 for MIPS TLS access.

11 years agoam c656d732: Merge "Always use v1 for MIPS TLS access."
Elliott Hughes [Tue, 18 Jun 2013 20:57:57 +0000 (13:57 -0700)]
am c656d732: Merge "Always use v1 for MIPS TLS access."

* commit 'c656d732c7712b0f73d9c560ccf3cb5ae47d219d':
  Always use v1 for MIPS TLS access.

11 years agoMerge "Always use v1 for MIPS TLS access."
Elliott Hughes [Tue, 18 Jun 2013 20:56:25 +0000 (20:56 +0000)]
Merge "Always use v1 for MIPS TLS access."

11 years agoam d98d35c5: am 0846109c: Merge "libc: Rename fortify error functions."
Nick Kralevich [Tue, 18 Jun 2013 20:31:56 +0000 (13:31 -0700)]
am d98d35c5: am 0846109c: Merge "libc: Rename fortify error functions."

* commit 'd98d35c5380ce398038d3062d40bc4fe082dce80':
  libc: Rename fortify error functions.

11 years agoam 3bf62790: am dd0880fe: Merge "libc: add limited FORTIFY_SOURCE support for clang"
Nick Kralevich [Tue, 18 Jun 2013 20:31:56 +0000 (13:31 -0700)]
am 3bf62790: am dd0880fe: Merge "libc: add limited FORTIFY_SOURCE support for clang"

* commit '3bf6279034e6a92c3550fae31c5c136bec61344a':
  libc: add limited FORTIFY_SOURCE support for clang

11 years agoam 45ef218b: am 6807af77: Merge "Make LD_PRELOAD failures just warnings."
Elliott Hughes [Tue, 18 Jun 2013 20:31:55 +0000 (13:31 -0700)]
am 45ef218b: am 6807af77: Merge "Make LD_PRELOAD failures just warnings."

* commit '45ef218bde353df455062aa3c9a9f84ffed769fc':
  Make LD_PRELOAD failures just warnings.

11 years agoam e421bd71: am 02002443: Merge "bionic: fix deleting property arrays in property...
Colin Cross [Tue, 18 Jun 2013 20:27:29 +0000 (13:27 -0700)]
am e421bd71: am 02002443: Merge "bionic: fix deleting property arrays in property benchmark"

* commit 'e421bd71c32e35b8f39f2e51f2d534d2f21f139f':
  bionic: fix deleting property arrays in property benchmark

11 years agoam 0846109c: Merge "libc: Rename fortify error functions."
Nick Kralevich [Tue, 18 Jun 2013 20:27:18 +0000 (13:27 -0700)]
am 0846109c: Merge "libc: Rename fortify error functions."

* commit '0846109c96d54a28e413893b0cd4b4acb3aa87fc':
  libc: Rename fortify error functions.

11 years agoam dd0880fe: Merge "libc: add limited FORTIFY_SOURCE support for clang"
Nick Kralevich [Tue, 18 Jun 2013 20:27:17 +0000 (13:27 -0700)]
am dd0880fe: Merge "libc: add limited FORTIFY_SOURCE support for clang"

* commit 'dd0880fec3bb8c998680e78aff9e2ddc2bcf6d7a':
  libc: add limited FORTIFY_SOURCE support for clang

11 years agoam 6807af77: Merge "Make LD_PRELOAD failures just warnings."
Elliott Hughes [Tue, 18 Jun 2013 20:27:16 +0000 (13:27 -0700)]
am 6807af77: Merge "Make LD_PRELOAD failures just warnings."

* commit '6807af773f862750efb6860e00402580a5f463f3':
  Make LD_PRELOAD failures just warnings.

11 years agoAlways use v1 for MIPS TLS access.
Elliott Hughes [Tue, 18 Jun 2013 20:26:22 +0000 (13:26 -0700)]
Always use v1 for MIPS TLS access.

Change-Id: Ic2850b90185cfbc5b0eff804c8b74a1c553c0852

11 years agoMerge "libc: Rename fortify error functions."
Nick Kralevich [Tue, 18 Jun 2013 20:24:03 +0000 (20:24 +0000)]
Merge "libc: Rename fortify error functions."

11 years agoam 02002443: Merge "bionic: fix deleting property arrays in property benchmark"
Colin Cross [Tue, 18 Jun 2013 20:23:51 +0000 (13:23 -0700)]
am 02002443: Merge "bionic: fix deleting property arrays in property benchmark"

* commit '02002443d4b17de78418d51fc303b4c976ad071a':
  bionic: fix deleting property arrays in property benchmark

11 years agoMerge "libc: add limited FORTIFY_SOURCE support for clang"
Nick Kralevich [Tue, 18 Jun 2013 20:23:49 +0000 (20:23 +0000)]
Merge "libc: add limited FORTIFY_SOURCE support for clang"

11 years agoMerge "Make LD_PRELOAD failures just warnings."
Elliott Hughes [Tue, 18 Jun 2013 20:23:07 +0000 (20:23 +0000)]
Merge "Make LD_PRELOAD failures just warnings."

11 years agoMerge "bionic: fix deleting property arrays in property benchmark"
Colin Cross [Tue, 18 Jun 2013 20:22:25 +0000 (20:22 +0000)]
Merge "bionic: fix deleting property arrays in property benchmark"

11 years agoam ba6c021a: am e2fb05b4: Merge "libc: Introduce __errordecl()"
Nick Kralevich [Tue, 18 Jun 2013 20:21:00 +0000 (13:21 -0700)]
am ba6c021a: am e2fb05b4: Merge "libc: Introduce __errordecl()"

* commit 'ba6c021a53376c75993cc9866deb7c7ff6e1750d':
  libc: Introduce __errordecl()

11 years agoam e2fb05b4: Merge "libc: Introduce __errordecl()"
Nick Kralevich [Tue, 18 Jun 2013 20:17:35 +0000 (13:17 -0700)]
am e2fb05b4: Merge "libc: Introduce __errordecl()"

* commit 'e2fb05b45b9af7b9af8df0ea15bfec63d331d882':
  libc: Introduce __errordecl()

11 years agoMerge "libc: Introduce __errordecl()"
Nick Kralevich [Tue, 18 Jun 2013 20:15:33 +0000 (20:15 +0000)]
Merge "libc: Introduce __errordecl()"

11 years agoMake LD_PRELOAD failures just warnings.
Elliott Hughes [Tue, 18 Jun 2013 20:15:00 +0000 (13:15 -0700)]
Make LD_PRELOAD failures just warnings.

This matches glibc and makes life easier for developers who want to
sometimes preload a library from init (which has no conditionals); they
can simply move/remove the library to disable.

Change-Id: I579b8633f958235af6e46bb53b378b9e363afb1f

11 years agobionic: fix deleting property arrays in property benchmark
Colin Cross [Tue, 18 Jun 2013 20:08:28 +0000 (13:08 -0700)]
bionic: fix deleting property arrays in property benchmark

Use delete[] to delete arrays allocated with new []

Change-Id: Icc2a6b23df09049c008f7f1f50ed93a277174308

11 years agoam 1a38e063: am 0005b354: Merge "bionic: change properties benchmarks to read a singl...
Colin Cross [Tue, 18 Jun 2013 20:07:58 +0000 (13:07 -0700)]
am 1a38e063: am 0005b354: Merge "bionic: change properties benchmarks to read a single property"

* commit '1a38e063830924efb8a6d9d7a6135ef54460cb9b':
  bionic: change properties benchmarks to read a single property

11 years agolibc: Rename fortify error functions.
Nick Kralevich [Tue, 18 Jun 2013 20:07:18 +0000 (13:07 -0700)]
libc: Rename fortify error functions.

__umask_error -> __umask_invalid_mode
__creat_error -> __creat_missing_mode
__too_many_args_error -> __creat_too_many_args

Change-Id: I4036f344a3a93628e70f2e948ad73cfed3a967ea

11 years agoam 0005b354: Merge "bionic: change properties benchmarks to read a single property"
Colin Cross [Tue, 18 Jun 2013 20:04:10 +0000 (13:04 -0700)]
am 0005b354: Merge "bionic: change properties benchmarks to read a single property"

* commit '0005b3544be345e697592b4dc199ebaa37048559':
  bionic: change properties benchmarks to read a single property

11 years agoMerge "bionic: change properties benchmarks to read a single property"
Colin Cross [Tue, 18 Jun 2013 20:01:04 +0000 (20:01 +0000)]
Merge "bionic: change properties benchmarks to read a single property"

11 years agobionic: change properties benchmarks to read a single property
Colin Cross [Tue, 18 Jun 2013 19:47:38 +0000 (12:47 -0700)]
bionic: change properties benchmarks to read a single property

The properties benchmarks were reading n properties from a property
area with n properties in it, which was making it hard to compare
the time between runs of different sizes.  Change the benchmark
to read a random property per iteration so the numbers between
runs are comparable.

Change-Id: Ib1648ce0948d9038fce76d209608427376cfb8da

11 years agolibc: add limited FORTIFY_SOURCE support for clang
Nick Kralevich [Mon, 17 Jun 2013 21:49:19 +0000 (14:49 -0700)]
libc: add limited FORTIFY_SOURCE support for clang

In 829c089f83ddee37203b52bcb294867a9ae7bdbc, we disabled all
FORTIFY_SOURCE support when compiling under clang. At the time,
we didn't have proper test cases, and couldn't easily create targeted
clang tests.

This change re-enables FORTIFY_SOURCE support under clang for a
limited set of functions, where we have explicit unittests available.
The functions are:

* memcpy
* memmove
* strcpy
* strncpy
* strcat
* strncat
* memset
* strlen (with modifications)
* strchr (with modifications)
* strrchr (with modifications)

It may be possible, in the future, to enable other functions. However,
I need to write unittests first.

For strlen, strchr, and strrchr, clang unconditionally calls the
fortified version of the relevant function. If it doesn't know the
size of the buffer it's dealing with, it passes in ((size_t) -1),
which is the largest possible size_t.

I added two new clang specific unittest files, primarily copied
from fortify?_test.cpp.

I've also rebuild the entire system with these changes, and didn't
observe any obvious problems.

Change-Id: If12a15089bb0ffe93824b485290d05b14355fcaa

11 years agolibc: Introduce __errordecl()
Nick Kralevich [Tue, 18 Jun 2013 17:46:02 +0000 (10:46 -0700)]
libc: Introduce __errordecl()

Define __errordecl and replace __attribute__((__error__("foo")))
with __errordecl. Make sure __errordecl is a no-op on clang, as it
generates a compile time warning.

Change-Id: Ifa1a2d3afd6881de9d479fc2adac6737871a2949

11 years agoam f6e6e5e7: am 977a3313: Merge changes Iac00ce10,I192d3825
Colin Cross [Tue, 18 Jun 2013 01:33:50 +0000 (18:33 -0700)]
am f6e6e5e7: am 977a3313: Merge changes Iac00ce10,I192d3825

* commit 'f6e6e5e72774e302c461767ca0c194f25502108e':
  bionic: add tests for properties
  bionic: move system property writing from init to bionic

11 years agoam 977a3313: Merge changes Iac00ce10,I192d3825
Colin Cross [Tue, 18 Jun 2013 01:21:37 +0000 (18:21 -0700)]
am 977a3313: Merge changes Iac00ce10,I192d3825

* commit '977a33137d2be0093f474055f839cf665b82b588':
  bionic: add tests for properties
  bionic: move system property writing from init to bionic

11 years agoMerge changes Iac00ce10,I192d3825
Colin Cross [Tue, 18 Jun 2013 01:11:58 +0000 (01:11 +0000)]
Merge changes Iac00ce10,I192d3825

* changes:
  bionic: add tests for properties
  bionic: move system property writing from init to bionic

11 years agobionic: add tests for properties
Colin Cross [Tue, 29 Jan 2013 01:19:43 +0000 (17:19 -0800)]
bionic: add tests for properties

(cherry picked from commit 37d9f75dde881a0ba1c1b3253b1be19d4096963d)

Change-Id: Iac00ce10a4272032a1cbdbc4204277d6876e3365

11 years agobionic: move system property writing from init to bionic
Colin Cross [Thu, 24 Jan 2013 07:07:06 +0000 (23:07 -0800)]
bionic: move system property writing from init to bionic

Move the implementation of writing to the system property area
from init to bionic, next to the reader implementation.  This
will allow full property testing to be added to bionic tests.

Add new accessor and waiting functions to hide the implementation
from watchprops and various bionic users.

Also hide some of the implementation details of the property area
from init by moving them into _system_properties.h, and other details
from everybody by moving them into system_properties.h.

(cherry picked from commit dc1038b7900acb664e99643d2974e1a0f4703781)

Change-Id: I192d3825ee276c5047bc751039fe6cfe226a7cca

11 years agoam d2dbf163: am 5995bf88: Merge "don\'t hardcode register r0/v1 when reading the...
Elliott Hughes [Mon, 17 Jun 2013 21:56:04 +0000 (14:56 -0700)]
am d2dbf163: am 5995bf88: Merge "don\'t hardcode register r0/v1 when reading the TLS"

* commit 'd2dbf16358bee4777a3e4937cf316fa8bb905559':
  don't hardcode register r0/v1 when reading the TLS

11 years agoam 5995bf88: Merge "don\'t hardcode register r0/v1 when reading the TLS"
Elliott Hughes [Mon, 17 Jun 2013 21:53:12 +0000 (14:53 -0700)]
am 5995bf88: Merge "don\'t hardcode register r0/v1 when reading the TLS"

* commit '5995bf880e2a7fac249382f0a929b7271c843122':
  don't hardcode register r0/v1 when reading the TLS

11 years agoMerge "don't hardcode register r0/v1 when reading the TLS"
Elliott Hughes [Mon, 17 Jun 2013 21:51:49 +0000 (21:51 +0000)]
Merge "don't hardcode register r0/v1 when reading the TLS"

11 years agodon't hardcode register r0/v1 when reading the TLS
Mathias Agopian [Sat, 15 Jun 2013 02:00:03 +0000 (19:00 -0700)]
don't hardcode register r0/v1 when reading the TLS

this leads to much improved code when calling __get_tls()

Change-Id: I21d870fb33c33a921ca55c4e100772e0f7a8d1e4

11 years agobionic: add tests for properties
Colin Cross [Tue, 29 Jan 2013 01:19:43 +0000 (17:19 -0800)]
bionic: add tests for properties

Change-Id: I09b212966f1c9624631653ef2c7a71de78bbbec1

11 years agobionic: move system property writing from init to bionic
Colin Cross [Thu, 24 Jan 2013 07:07:06 +0000 (23:07 -0800)]
bionic: move system property writing from init to bionic

Move the implementation of writing to the system property area
from init to bionic, next to the reader implementation.  This
will allow full property testing to be added to bionic tests.

Add new accessor and waiting functions to hide the implementation
from watchprops and various bionic users.

Also hide some of the implementation details of the property area
from init by moving them into _system_properties.h, and other details
from everybody by moving them into system_properties.h.

Change-Id: I9026e604109e30546b2849b60cab2e7e5ff00ba5

11 years agoam afd4e299: am 657d0da7: Merge "Slight script cleanup; make gensyscalls work from...
Elliott Hughes [Mon, 17 Jun 2013 18:22:01 +0000 (11:22 -0700)]
am afd4e299: am 657d0da7: Merge "Slight script cleanup; make gensyscalls work from any directory."

* commit 'afd4e2999c3e726498c407fcaf9cccdcd4d24637':
  Slight script cleanup; make gensyscalls work from any directory.

11 years agoam 657d0da7: Merge "Slight script cleanup; make gensyscalls work from any directory."
Elliott Hughes [Mon, 17 Jun 2013 18:18:58 +0000 (11:18 -0700)]
am 657d0da7: Merge "Slight script cleanup; make gensyscalls work from any directory."

* commit '657d0da7513e01b0eb104c8a8a522c28fdbc807d':
  Slight script cleanup; make gensyscalls work from any directory.

11 years agoMerge "Slight script cleanup; make gensyscalls work from any directory."
Elliott Hughes [Mon, 17 Jun 2013 18:16:36 +0000 (18:16 +0000)]
Merge "Slight script cleanup; make gensyscalls work from any directory."

11 years agoSlight script cleanup; make gensyscalls work from any directory.
Elliott Hughes [Mon, 17 Jun 2013 17:26:10 +0000 (10:26 -0700)]
Slight script cleanup; make gensyscalls work from any directory.

Also remove a ton of dead code.

Change-Id: I1315623695a004f643b155f121cbafe24b715b8a

11 years agoFix remove_uidiface_info failing on first entry
Chad Brubaker [Fri, 14 Jun 2013 22:25:42 +0000 (15:25 -0700)]
Fix remove_uidiface_info failing on first entry

Change-Id: Ic23506581ff835a6b679e1593eab550a84548056

11 years agoam c1e4183c: am 560e9f7e: Merge "Ensure that <stdint.h> defines SIZE_MAX and friends."
Elliott Hughes [Fri, 14 Jun 2013 01:04:19 +0000 (18:04 -0700)]
am c1e4183c: am 560e9f7e: Merge "Ensure that <stdint.h> defines SIZE_MAX and friends."

* commit 'c1e4183c7ad6943f9cc44fe0b769884370a739cd':
  Ensure that <stdint.h> defines SIZE_MAX and friends.

11 years agoam 560e9f7e: Merge "Ensure that <stdint.h> defines SIZE_MAX and friends."
Elliott Hughes [Thu, 13 Jun 2013 23:21:55 +0000 (16:21 -0700)]
am 560e9f7e: Merge "Ensure that <stdint.h> defines SIZE_MAX and friends."

* commit '560e9f7e7a39e02aca96709043ca06f562f75d58':
  Ensure that <stdint.h> defines SIZE_MAX and friends.

11 years agoMerge "Ensure that <stdint.h> defines SIZE_MAX and friends."
Elliott Hughes [Thu, 13 Jun 2013 23:19:09 +0000 (23:19 +0000)]
Merge "Ensure that <stdint.h> defines SIZE_MAX and friends."

11 years agoEnsure that <stdint.h> defines SIZE_MAX and friends.
Elliott Hughes [Thu, 13 Jun 2013 23:02:53 +0000 (16:02 -0700)]
Ensure that <stdint.h> defines SIZE_MAX and friends.

We were missing SIG_ATOMIC_MAX, SIG_ATOMIC_MIN, SIZE_MAX,
WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.

Change-Id: I2535f36bc220fbaea009b483599b7af811c4cb5c

11 years agoam af975b07: am c843a3e7: Merge "Fix the qsort copyright notice (fixed upstream this...
Elliott Hughes [Thu, 13 Jun 2013 00:51:25 +0000 (17:51 -0700)]
am af975b07: am c843a3e7: Merge "Fix the qsort copyright notice (fixed upstream this afternoon)."

* commit 'af975b076f79b35cb115c0f77fc8fc0e5d3dba67':
  Fix the qsort copyright notice (fixed upstream this afternoon).

11 years agoam c843a3e7: Merge "Fix the qsort copyright notice (fixed upstream this afternoon)."
Elliott Hughes [Thu, 13 Jun 2013 00:46:57 +0000 (17:46 -0700)]
am c843a3e7: Merge "Fix the qsort copyright notice (fixed upstream this afternoon)."

* commit 'c843a3e7b215bca5e896e1d56c2fa6332770ea83':
  Fix the qsort copyright notice (fixed upstream this afternoon).