Commit graph

2339 commits

Author SHA1 Message Date
Elliott Hughes
53493a9b26 Merge "Sort NOTICE entries." 2012-08-14 15:31:18 -07:00
Elliott Hughes
261e2232c1 Sort NOTICE entries.
Also make sure we get the whole of any copyright header, in case
there's text before the "Copyright" line.

Change-Id: Iabcc5e0931a39c0107b833539fec7c5a3d134592
2012-08-14 15:04:05 -07:00
Elliott Hughes
b6a971962a Merge "More cleanup." 2012-08-14 15:02:40 -07:00
Elliott Hughes
bedfe38b8b More cleanup.
Make more stuff static, remove some dead code, and fix a few typos.

Change-Id: I010b0eadeaf61e2899c37014ad1e7082c70bd510
2012-08-14 14:07:59 -07:00
Elliott Hughes
b7c6991c9a Merge "Update MS_ mount flags, define unshare() syscall." 2012-08-14 12:14:29 -07:00
Jeff Sharkey
74c0464006 Update MS_ mount flags, define unshare() syscall.
(cherry-pick of 82393decdfc6b0383054fb5d2f54725bbee88b8c.)

Bug: 6925012
Change-Id: I4f962d8975ad62ff4b9983150f9e481796092b9d
2012-08-14 12:09:25 -07:00
Elliott Hughes
b9c6854cd9 Merge "linker: avoid clobbering the .dynamic section of shared libs" 2012-08-14 12:07:18 -07:00
Elliott Hughes
c50e019734 Merge "Switch to upstream NetBSD tdelete/tfind/tsearch." 2012-08-14 11:56:30 -07:00
Ard Biesheuvel
12c78bbded linker: avoid clobbering the .dynamic section of shared libs
This patch removes the DT_NEEDED hack which stores pointers
to soinfo structs in the .dynamic section of the library
being loaded.

Instead, it caches the soinfo struct pointers on the stack
during relocation time. After relocation time, i.e. when
calling constructors and destructors of the shared library
and its dependencies, uncached access is used instead,
doing lookups using the string table entries pointed to by
the DT_NEEDED entries.

By removing this hack, it is no longer needed to undo the
PT_GNURELRO protection, i.e., all non-writable mappings
can remain non-writable during their entire lifespan.

Even though, strictly speaking, the algorithmic complexity
has increased somewhat, the real-world adverse effect
is negligible on the systems I have tested.

Change-Id: I2361502560b96b5878f7f94a8e8a215350d70d64
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-14 19:38:28 +02:00
Elliott Hughes
409302f0f9 Switch to upstream NetBSD tdelete/tfind/tsearch.
tdestroy is a GNU extension, so that stays.

Change-Id: Iedebaff25ea7e92b1ab1dd4440da12b67b99aa40
2012-08-13 17:41:49 -07:00
Elliott Hughes
54655eaf92 Merge "Fix nice..." 2012-08-13 16:56:18 -07:00
Elliott Hughes
3d2d448af1 Fix nice...
...by switching to the NetBSD implementation.

Change-Id: I562b27b237a24ded95804035cc322c7bff12ff59
2012-08-13 16:38:29 -07:00
Elliott Hughes
b66bc51423 Merge "Clean up warnings in stubs.cpp." 2012-08-13 16:17:55 -07:00
Elliott Hughes
de727caee2 Clean up warnings in stubs.cpp.
Switch to C++ to get extra warnings, and format the code Google style.

Change-Id: Ifc0131bf297a6ee8a8a6b8d049a02518b0b1a4b7
2012-08-13 16:10:19 -07:00
Elliott Hughes
222eec2ecf Merge "Handle naming for system uids running as secondary users" 2012-08-13 14:45:27 -07:00
Amith Yamasani
bf9441efb8 Handle naming for system uids running as secondary users
Allow naming such as u1_system, u2_radio, u2_media.
Forward and reverse mapping for the above.

(cherry-pick of c60a0027b1ef3bc4929d2023e7083fbce12fafe7.)

Change-Id: I46eeb23fee4f57b2907640570504123d3ce99985
2012-08-13 14:19:16 -07:00
Elliott Hughes
440e417d5f Merge "Add dependencies on all the makefiles." 2012-08-13 14:12:02 -07:00
Elliott Hughes
ae5c64413b Add dependencies on all the makefiles.
This should help prevent broken builds next time I'm messing with
assembler/compiler/linker flags...

Change-Id: I30f15a3ce3c3f3c60cad7bc59aaba9f42d792224
2012-08-13 14:06:05 -07:00
Elliott Hughes
66fba00991 Merge "Update arch-mips/asm/unistd.h for the newer syscalls" 2012-08-13 12:42:01 -07:00
Raghu Gandham
7d9f1c46bb Update arch-mips/asm/unistd.h for the newer syscalls
Change-Id: Ie292c091cbf4b972e1b5faa7d779645c6e4442f0
2012-08-13 11:54:53 -07:00
Elliott Hughes
a61ac5257b Merge "Fix module constructor order." 2012-08-13 11:06:53 -07:00
Evgeniy Stepanov
9181a5dcfe Fix module constructor order.
.preinit_array goes before the constructors of LD_PRELOAD-ed libraries.

Change-Id: I1af32ce29eaf3ca4351ae8a0f7f5da5165853216
2012-08-13 11:05:47 -07:00
Nick Kralevich
20b94c0ce9 Merge "linker: don't perform unnecessary mprotects" 2012-08-13 09:28:54 -07:00
Nick Kralevich
5135b3ae6e linker: don't perform unnecessary mprotects
The linker only needs to mark the text segment as
writable iff the file has text relocations. Unnecessarily
calling mprotect when it isn't necessary is slow, and some
security enhanced kernels don't like it. Pages which are
simultaneously writable and executable are considered a no-no.

The vast majority of executables / shared libraries on Android
do NOT have text relocations.

Change-Id: Ic38ce30a99b7e33ecf21efd9c108547a58eafa35
2012-08-13 08:50:11 -07:00
Elliott Hughes
072a7e6ced Merge "MIPS support to the libc Makefile" 2012-08-11 09:36:05 -07:00
Raghu Gandham
a4c7933b49 MIPS support to the libc Makefile
Change-Id: Ia1f3f545ca61a5abb235e99046cb3cdaf24d4205
2012-08-10 17:24:02 -07:00
Ben Cheng
0bf5cf87c6 Merge "Set the dynamic field in the link map for the linker itself." 2012-08-10 16:46:09 -07:00
Ben Cheng
06f0e74a2b Set the dynamic field in the link map for the linker itself.
Otherwise gdb will print a spurious warning each time gdb is used:

warning: .dynamic section for "/system/bin/linker" is not at the expected
address (wrong library or version mismatch?)

BUG:6946614
Change-Id: Ib21b8db0615751189c1601140deb43bc089289b6
2012-08-10 16:07:02 -07:00
Elliott Hughes
316ee626b7 Merge "MIPS support to sigsuspend and sigwait routines" 2012-08-10 15:05:36 -07:00
Nick Kralevich
38a02b4b80 Merge "crtend*: Add GNU_STACK note" 2012-08-10 14:29:27 -07:00
Nick Kralevich
6eee1fc68f crtend*: Add GNU_STACK note
Add a GNU_STACK marker to crtend* files. This tells the linker
that these files do not require an executable stack.

When linking, a missing GNU_STACK marker in any .o file can prevent
the compiler from automatically marking the final executable as NX
safe (executable stack not required).  In Android, we normally work
around this by adding -Wa,--noexecstack / -Wl,-z,noexecstack.
For files like crtend.S / crtend_so.S, which are included in every
executable / shared library, it's better to add the GNU_STACK note
directly to the assembly file.  This allows the compiler to
automatically mark the final executable as NX safe without any
special command line options.

References: http://www.gentoo.org/proj/en/hardened/gnu-stack.xml

Change-Id: I07bd058f9f60ddd8b146e0fb36ba26ff84c0357d
2012-08-10 14:12:00 -07:00
Elliott Hughes
3ede900b64 Merge "Revert "Revert "Switch to NetBSD's strxfrm(3).""" 2012-08-10 14:03:06 -07:00
Elliott Hughes
a1822dced3 Merge "Add unshare() syscall." 2012-08-10 12:59:49 -07:00
Jeff Sharkey
e36c826f7a Add unshare() syscall.
(cherry-pick of 5467f25f82934d611c60f8bc57a05114f3c1bea0.)

Bug: 6925012
Change-Id: Ic5ea2fbd606311087de05d7a3594df2fa9b2fef9
2012-08-10 12:57:43 -07:00
Elliott Hughes
f91e2f7286 Merge "Fix typo in SIGTTOU description." 2012-08-10 12:27:06 -07:00
Elliott Hughes
01030e6388 Fix typo in SIGTTOU description.
Change-Id: Ie0db3e7df3e1f17b43f5645d027a90603139be2f
2012-08-10 12:23:58 -07:00
Elliott Hughes
f8b3a920a8 Revert "Revert "Switch to NetBSD's strxfrm(3).""
This reverts commit 8793e7c7d2,
and fixes the build by building upstream NetBSD source as a
separate library that's then swallowed whole into libc_common.

Change-Id: I6c9317d8c48b5ccaf85a7b185bc07fb31176ff97
2012-08-10 12:10:10 -07:00
Elliott Hughes
4ec9e343cf Merge "Revert "Switch to NetBSD's strxfrm(3)."" 2012-08-10 11:36:31 -07:00
Elliott Hughes
8793e7c7d2 Revert "Switch to NetBSD's strxfrm(3)."
This reverts commit be1d78b0dc

Change-Id: I11a95db474796f3da004f27652b081d5ba4ec9b4
2012-08-10 11:36:17 -07:00
Elliott Hughes
9ad1d6f58c Merge "Switch to NetBSD's strxfrm(3)." 2012-08-10 11:23:30 -07:00
Elliott Hughes
be1d78b0dc Switch to NetBSD's strxfrm(3).
There were two bugs in our implementation. Intel found one, but another
remainined, and tracking upstream is the way forward for functions where
we add no value.

Change-Id: Ida9bac0293fb2c4cbc942b1e0515ee0477c6538b
2012-08-10 11:03:02 -07:00
Raghu Gandham
abd10011a7 MIPS support to sigsuspend and sigwait routines
Change-Id: I870e798ed7eac5a8c74e5784a670f3a4f24331a9
2012-08-09 18:51:19 -07:00
Elliott Hughes
0836a7ffb1 Merge "Auto-generate a complete NOTICE file." 2012-08-09 16:25:19 -07:00
Elliott Hughes
387d4b7de9 Auto-generate a complete NOTICE file.
Remove the hand-collated ones, and switch to a script that pulls the
copyright headers out of every file and collects the unique ones.

Change-Id: Ied3b98b3f56241df97166c410ff81de4e0157c9d
2012-08-09 16:05:31 -07:00
Elliott Hughes
709bb0f79c Merge "Remove ThirdPartyProject.prop." 2012-08-09 14:31:27 -07:00
Elliott Hughes
df675370d7 Remove ThirdPartyProject.prop.
These are dead. I cleaned up external/ a long time ago, but didn't
realize there were any in the main tree.

Change-Id: I5f35b2da132558e2763164285eb38629cd68ffda
2012-08-09 14:29:23 -07:00
Elliott Hughes
a17b85d97b Merge "Remove the last .jam file." 2012-08-09 11:59:20 -07:00
Elliott Hughes
a554212992 Remove the last .jam file.
How did I miss this before?

Change-Id: I2e582133fc4800656fdd81104f8dfc7ee8f5b580
2012-08-09 11:54:23 -07:00
Elliott Hughes
d504eee9fa Merge "MIPS support to sys/ headers" 2012-08-08 16:32:55 -07:00
Elliott Hughes
f655ce7ef3 Merge "Fix x86 build." 2012-08-08 16:07:27 -07:00