Commit graph

2034 commits

Author SHA1 Message Date
Nick Kralevich
83a73d1afe crtbegin: eliminate duplicate code
crtbegin_dynamic and crtbegin_static are essentially identical,
minus a few trivial differences (comments and whitespace).

Eliminate duplicates.

Change-Id: Ic9fae6bc9695004974493b53bfc07cd3bb904480
2012-05-30 11:45:12 -07:00
The Android Open Source Project
1ebb243d1a am cb9ba3c8: Reconcile with jb-release
* commit 'cb9ba3c88a97f34784559a55317ff5970d4c4dba':
  Print the corrupted address passed to free().
2012-05-29 09:41:51 -07:00
The Android Open Source Project
cb9ba3c88a Reconcile with jb-release
Change-Id: Id0b365ef6729dc36b88193f1675d3819e56bd426
2012-05-29 09:39:17 -07:00
Elliott Hughes
1dd9efc541 Merge "Use mmap to read an initial ELF header of library" 2012-05-25 15:11:35 -07:00
Ji-Hwan Lee
75917c84d1 Use mmap to read an initial ELF header of library
Also, fixes SIGSEV during calculation of si->phdr in load_library(),
which is caused by accessing PHDR area, which is not guaranteed to be
loaded.

Note that this usually does not happen because program header area is
covered by immediately following PT_LOAD entry.  But it does not hold
always.

Bug: 6561258
Change-Id: Ie376253c773b5420279ca89044e81b1aad5a5736
2012-05-26 06:15:50 +09:00
Ben Cheng
2481468f22 Print the corrupted address passed to free().
For example:

@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x5c3bfbd0
Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2942

The addr=0x5c3bfbd0 part is new.

Change-Id: I8670144b2b0a3a6182384150d762c97dfee5452f
2012-05-25 11:14:20 -07:00
Ben Cheng
41c2a112c2 am d7b60b20: am c84ff11d: Print the corrupted address passed to free().
* commit 'd7b60b207be79513b99faf2ef576db333f9c7a78':
  Print the corrupted address passed to free().
2012-05-24 17:23:43 -07:00
Ben Cheng
d7b60b207b am c84ff11d: Print the corrupted address passed to free().
* commit 'c84ff11dad26435dc5760bceda18e8f1175a6061':
  Print the corrupted address passed to free().
2012-05-24 17:21:03 -07:00
Ben Cheng
c84ff11dad Print the corrupted address passed to free().
For example:

@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x5c3bfbd0
Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2942

The addr=0x5c3bfbd0 part is new.

Change-Id: I8670144b2b0a3a6182384150d762c97dfee5452f
2012-05-24 17:06:43 -07:00
Jean-Baptiste Queru
15ed08d065 am d155ba57: am c7882ab2: Merge "bionic: add clean kernel header ucontext.h"
* commit 'd155ba57a32ce3182d8a5b79ff27bc5e7fa55df9':
  bionic: add clean kernel header ucontext.h
2012-05-21 12:41:30 -07:00
Elliott Hughes
7cce04381a resolved conflicts for merge of dc6c2b77 to master
Change-Id: Ifab4573a825cf5caa7158d8888243bb8d5d01148
2012-05-17 17:15:01 -07:00
Jean-Baptiste Queru
d155ba57a3 am c7882ab2: Merge "bionic: add clean kernel header ucontext.h"
* commit 'c7882ab2a99a74c8f772ab03fdfd9a3b53515e46':
  bionic: add clean kernel header ucontext.h
2012-05-17 13:28:10 -07:00
Jean-Baptiste Queru
c7882ab2a9 Merge "bionic: add clean kernel header ucontext.h" 2012-05-17 12:25:02 -07:00
Elliott Hughes
dc6c2b779b am 70cf0bc0: Merge "Remove the last references to SuperH."
* commit '70cf0bc0496a1d4c0e83fe3f1933f667ab66c148':
  Remove the last references to SuperH.
2012-05-16 17:18:23 -07:00
Elliott Hughes
70cf0bc049 Merge "Remove the last references to SuperH." 2012-05-16 09:56:37 -07:00
Nick Kralevich
d8f9198644 am 1727a041: am cf8e554c: (-s ours) Merge "Make the linker relocatable."
* commit '1727a041b59995b00c1d497022600be929bcaf3e':
  Make the linker relocatable.
2012-05-16 09:17:32 -07:00
Nick Kralevich
38e81b4294 am 574e8ec2: am 36e0345a: Merge "linker: set LOCAL_NO_CRT := true"
* commit '574e8ec28fac106a5e9b2c98b7b5a4e9532ecf5c':
  linker: set LOCAL_NO_CRT := true
2012-05-16 09:15:15 -07:00
Nick Kralevich
ed434302f0 am ee6916c0: am 1adc7c03: Merge "linker: Fix the computation of si->base"
* commit 'ee6916c00718185df3930a18050e5b47685ef524':
  linker: Fix the computation of si->base
2012-05-16 09:15:14 -07:00
Nick Kralevich
82576526e3 am c62d55cb: am cd6b2007: (-s ours) Merge "Add linker support for PIE"
* commit 'c62d55cbaef8001c7eb0a8d5e85e2fc72283063a':
  Add linker support for PIE
2012-05-16 09:15:07 -07:00
Nick Kralevich
1727a041b5 am cf8e554c: (-s ours) Merge "Make the linker relocatable."
* commit 'cf8e554c72af1dd634d4f36a9065e34e853f8714':
  Make the linker relocatable.
2012-05-16 09:14:22 -07:00
Nick Kralevich
574e8ec28f am 36e0345a: Merge "linker: set LOCAL_NO_CRT := true"
* commit '36e0345af89e2ed768ed38dcdf016a7640cf8ba5':
  linker: set LOCAL_NO_CRT := true
2012-05-16 09:11:52 -07:00
Nick Kralevich
ee6916c007 am 1adc7c03: Merge "linker: Fix the computation of si->base"
* commit '1adc7c03898ee1f6a4c7f8cffa3c07507b9da5a9':
  linker: Fix the computation of si->base
2012-05-16 09:11:50 -07:00
Nick Kralevich
c62d55cbae am cd6b2007: (-s ours) Merge "Add linker support for PIE"
* commit 'cd6b2007b851f1cfa47d8bcc7ec859dfa7557382':
  Add linker support for PIE
2012-05-16 09:11:49 -07:00
The Android Open Source Project
75931ee6e1 am 918e6a73: Reconcile with jb-release nakasi-factoryrom-release
* commit '918e6a730cd059392ee6d8b5c5a0f5fa0e5bbd93':
  Revert "linker: remove STB_LOCAL hack"
  Revert "Reference __dso_handle in PIC way"
  Revert "Use the new NativeDaemonConnector style."
  libc: Add __aeabi_llsl and __aeabi_llsr to libgcc_compat
2012-05-16 08:34:13 -07:00
The Android Open Source Project
918e6a730c Reconcile with jb-release nakasi-factoryrom-release
Change-Id: I5a5b95da6c33afbc36893e162f3b57c09c161ee2
2012-05-16 08:31:49 -07:00
Elliott Hughes
e33af61c70 Remove the last references to SuperH.
Change-Id: Icb44c1f94cb178d90b4c2b1e8f6d175586aec4e1
2012-05-15 17:08:41 -07:00
Ying Wang
fc9e525fe0 Rename the misleading var name TARGET_OUT_STATIC_LIBRARIES
TARGET_OUT_STATIC_LIBRARIES is actually the same as
TARGET_OUT_INTERMEDIATE_LIBRARIES.

Change-Id: I11ac35256031d461d20156cd4c19ed7eae781d22
2012-05-15 15:15:11 -07:00
Nick Kralevich
cf8e554c72 Merge "Make the linker relocatable." 2012-05-15 15:10:24 -07:00
Nick Kralevich
36e0345af8 Merge "linker: set LOCAL_NO_CRT := true" 2012-05-15 15:10:12 -07:00
Nick Kralevich
1adc7c0389 Merge "linker: Fix the computation of si->base" 2012-05-15 15:10:01 -07:00
Nick Kralevich
cd6b2007b8 Merge "Add linker support for PIE" 2012-05-15 15:09:45 -07:00
Nick Kralevich
dcbc3787bf Make the linker relocatable.
Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: Ia80273d7a00ff648b4da545f4b69debee6343968
2012-05-15 10:41:14 -07:00
Nick Kralevich
e742c1f564 linker: set LOCAL_NO_CRT := true
Use LOCAL_NO_CRT to prevent linking against crtbegin.o, rather than
messing with build rules. This also prevents linking against crtend.o,
which isn't needed for the linker.

Change-Id: I0c5b9999be7e8676560fe145c1c033ffce8db4d1
2012-05-15 10:08:39 -07:00
David 'Digit' Turner
077891b199 linker: Fix the computation of si->base
The computation of si->base assumed that the first entry in the
program header table is a PT_PHDR. This results in the dynamic
linker crashing with a SIGSEGV/MAPERR when trying to load some
of the NDK unit test programs, which happen to have an EXIDX
header first, followed byu a PHDR one.

This patch fixes the computation by parsing the program header
table, looking explicitely for the PHDR entry. This fixes the
load of the NDK unit test programs, and doesn't affect system
libraries.

Change-Id: Id18ea6037dbe950b5abbbce816c2960321f0b81d
2012-05-15 09:58:33 -07:00
Nick Kralevich
6cdefd06c0 Add linker support for PIE
Modify the dynamic linker so that executables can be loaded
at locations other than 0x00000000.

Modify crtbegin* so that non-PIC compilant "thumb interwork
veneers" are not created by the linker.

Bug: 5323301
Change-Id: Iece0272e2b708c79034f302c20160e1fe9029588
2012-05-15 09:56:32 -07:00
Kito Cheng
c425bc0532 bionic: add clean kernel header ucontext.h
Change-Id: I34fd0b0147fa33fd74c13480bc11827634233a41
2012-05-14 01:42:12 +08:00
Elliott Hughes
1b56aaa659 am f2f7bf76: am 4f05d1c7: Merge "bionic/x86: Optimization for memcpy"
* commit 'f2f7bf76dfd1d6014ed3baa1e27b221388e70a09':
  bionic/x86: Optimization for memcpy
2012-05-10 23:15:00 -07:00
Elliott Hughes
f2f7bf76df am 4f05d1c7: Merge "bionic/x86: Optimization for memcpy"
* commit '4f05d1c758ba141c617f25251a661ecb66627e9e':
  bionic/x86: Optimization for memcpy
2012-05-10 21:31:48 -07:00
Elliott Hughes
4f05d1c758 Merge "bionic/x86: Optimization for memcpy" 2012-05-10 10:14:44 -07:00
Iliyan Malchev
83a38b8c44 am 8034415d: resolved conflicts for merge of 08e72d01 to jb-dev-plus-aosp
* commit '8034415ddd8404f8788199ed993af89692235dc5':
  bionic: add support for non-NEON memcpy() on NEON SoCs
2012-05-10 09:24:46 -07:00
Iliyan Malchev
8034415ddd resolved conflicts for merge of 08e72d01 to jb-dev-plus-aosp
Change-Id: If00e354a5953ed54b31963d4f8ea77e1603c321e
2012-05-10 09:19:59 -07:00
The Android Automerger
4dc3a7e1ed merge in jb-release history after reset to jb-dev 2012-05-10 06:59:27 -07:00
Elliott Hughes
537867aed8 am 804147cb: am edb7cad9: Merge "Actually set the header guard in "linux-syscalls.h"."
* commit '804147cb7d533f5635da6adc28fbca1467a3078b':
  Actually set the header guard in "linux-syscalls.h".
2012-05-09 20:12:40 -07:00
Elliott Hughes
804147cb7d am edb7cad9: Merge "Actually set the header guard in "linux-syscalls.h"."
* commit 'edb7cad9b764f029c5faac2750f749d3d84bd86a':
  Actually set the header guard in "linux-syscalls.h".
2012-05-09 20:10:14 -07:00
Elliott Hughes
edb7cad9b7 Merge "Actually set the header guard in "linux-syscalls.h"." 2012-05-09 16:39:40 -07:00
Elliott Hughes
1928523c87 Actually set the header guard in "linux-syscalls.h".
Spotted while merging a MIPS change.

Change-Id: I36fb5a07d0bba0c117e9fe9733957bd37ca4b4c0
2012-05-09 16:34:11 -07:00
Elliott Hughes
2a5fab9a5f am dbd5ecad: resolved conflicts for merge of e5408907 to jb-dev-plus-aosp
* commit 'dbd5ecad26e39281bb83f97664bc32555c5c071a':
  [MIPS] Add support for MIPS syscalls
2012-05-09 13:57:12 -07:00
Elliott Hughes
dbd5ecad26 resolved conflicts for merge of e5408907 to jb-dev-plus-aosp
Change-Id: If4c3f51bf87b28da8074be2e46ae772a374b266f
2012-05-09 13:53:37 -07:00
Prajakta Gudadhe
08e72d0161 bionic: add support for non-NEON memcpy() on NEON SoCs
Some SoCs that support NEON nevertheless perform better with a non-NEON than a
NEON memcpy().  This patch adds build variable ARCH_ARM_USE_NON_NEON_MEMCPY,
which can be set in BoardConfig.mk.  When ARCH_ARM_USE_NON_NEON_MEMCPY is
defined, we compile in the non-NEON optimized memcpy() even if the SoC supports
NEON.

Change-Id: Ia0e5bee6bad5880ffc5ff8f34a1382d567546cf9
2012-05-09 13:34:31 -07:00
Elliott Hughes
fd8bd2c432 am 58a00b49: am 7eb1cc23: Merge "bionic: allow the board to customize MALLOC_ALIGNMENT"
* commit '58a00b4977b6fa073a8f56d94d741b1e4cb49856':
  bionic: allow the board to customize MALLOC_ALIGNMENT
2012-05-09 12:56:15 -07:00