Commit Graph

2565 Commits

Author SHA1 Message Date
Nick Kralevich
e026b1d89a Merge "ARM: remove dummy entries from .so init_array/fini_array" 2012-08-28 12:49:46 -07:00
Nick Kralevich
ad18073897 Merge "linker: Fix ARM_R_COPY relocations" 2012-08-28 12:48:01 -07:00
Nick Kralevich
d39c3abd5a linker: Fix ARM_R_COPY relocations
Per http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044d/IHI0044D_aaelf.pdf
Section 4.7.1.10, ARM_R_COPY relocations are only suppose to reference shared
libraries, not the executable itself.  When resolving an R_ARM_COPY symbol,
ensure we don't look in our own symbol.

This partially addresses
http://code.google.com/p/android/issues/detail?id=28598 .  After this
patch, the printfs generated by the test program are:

global = 0x42 (0x401c7000)
global = 0x42 (0x11000)

before, the output was:

global = 0x42 (0x40071000)
global = 0x0 (0x11000)

I'm still not very happy with this patch, but I think it's an improvement
over where we were at before.

This change was modeled after https://android-review.googlesource.com/38871

Change-Id: Id7ad921e58395e76a36875bcc742ec5eeba53f08
2012-08-28 11:48:32 -07:00
Nick Kralevich
c7d9c40012 am c410a961: Merge "libc: remove ctors/dtors sections"
* commit 'c410a9613a837790d2ea13aee3f88881e0d54c17':
  libc: remove ctors/dtors sections
2012-08-28 10:34:14 -07:00
Nick Kralevich
c410a9613a Merge "libc: remove ctors/dtors sections" 2012-08-28 10:20:27 -07:00
Ard Biesheuvel
144c291866 ARM: warn about atexit() calls from legacy shared libraries
Legacy ARM shared libraries use this generic version of atexit(),
which queues exit functions for invocation at program exit, at
which time the library may have been dlclose()'d, causing the
program to crash.

Change-Id: I41ae153c23268daa65ede7fb8966fc3e9caec369
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-28 11:23:06 +02:00
Ard Biesheuvel
f3cfcd869d ARM: make CRT_LEGACY_WORKAROUND work as intended
To properly support legacy ARM shared libraries, libc.so needs
to export the symbols __dso_handle and atexit, even though
these are now supplied by the crt startup code.

This patch reshuffles the existing CRT_LEGACY_WORKAROUND
conditionally compiled code slightly so it works as the
original author likely intended.

Change-Id: Id6c0e94dc65b7928324a5f0bad7eba6eb2f464b9
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-28 10:27:02 +02:00
Ard Biesheuvel
c23092887f ARM: remove dummy entries from .so init_array/fini_array
The runtime linker parses the ELF section headers to
discover the size of the init_array and fini_array, so
there is no point in putting NULL terminators at the end.

Change-Id: I3246cd585efce9314155600277dd829e9f37d04f
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-28 09:55:51 +02:00
Nick Kralevich
775dabd4d7 am 9dfaa63a: Merge "Allow linker to compile with -DLINKER_DEBUG=1"
* commit '9dfaa63a1c0d1b8e75dd9d7077a8103a19821fa9':
  Allow linker to compile with -DLINKER_DEBUG=1
2012-08-27 16:06:34 -07:00
Nick Kralevich
9dfaa63a1c Merge "Allow linker to compile with -DLINKER_DEBUG=1" 2012-08-27 16:00:50 -07:00
Elliott Hughes
d2d8031df1 am bc366292: Merge "Added missing cache failed notification"
* commit 'bc366292ff47ad9a5053e213ec253992baeee648':
  Added missing cache failed notification
2012-08-27 15:18:52 -07:00
Elliott Hughes
bc366292ff Merge "Added missing cache failed notification" 2012-08-27 15:00:51 -07:00
Nick Kralevich
3697b52605 Allow linker to compile with -DLINKER_DEBUG=1
Change-Id: I27e734048cbcb9ed936369115582b3c734de1280
2012-08-24 17:11:45 -07:00
Ian Rogers
05fddb41d0 am a37ce7fa: Merge "Add missing va_end() to prevent stack corruptions"
* commit 'a37ce7faa6d6c7355e3c6f6e09e5268cbf29c291':
  Add missing va_end() to prevent stack corruptions
2012-08-24 15:21:12 -07:00
Ian Rogers
a37ce7faa6 Merge "Add missing va_end() to prevent stack corruptions" 2012-08-24 15:10:07 -07:00
Nick Kralevich
e8198b97c3 am 26facba2: Merge "hardening: remove pointless ARM __get_pc() function"
* commit '26facba288df013fd898f8df12d84e5669ece6eb':
  hardening: remove pointless ARM __get_pc() function
2012-08-22 11:55:59 -07:00
Ard Biesheuvel
0a150ead18 libc: remove ctors/dtors sections
None of the supported ARCHs actually populate these sections,
so there is no point in keeping them in the binaries.

Change-Id: I21a364f510118ac1114e1b49c53ec8c895c6bc6b
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-22 20:45:26 +02:00
Nick Kralevich
26facba288 Merge "hardening: remove pointless ARM __get_pc() function" 2012-08-22 11:41:53 -07:00
Ard Biesheuvel
404e28ff8c hardening: remove pointless ARM __get_pc() function
Useful if you're trying to defeat ASLR, otherwise not
so much ...

Change-Id: I17ebb50bb490a3967db9c3038f049adafe2b8ea7
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-22 20:38:54 +02:00
Jean-Baptiste Queru
170ad35419 am c7de0225: Merge "Use unambiguous mnemonics"
* commit 'c7de02259052b1eeebbfd3a0c21acf56a7e84357':
  Use unambiguous mnemonics
2012-08-22 07:30:56 -07:00
Jean-Baptiste Queru
c7de022590 Merge "Use unambiguous mnemonics" 2012-08-22 07:18:50 -07:00
Kevin Schoedel
c0b4d18d7d Use unambiguous mnemonics
Change-Id: I8da0af54cc3cbf69d9e485eb71bc44a6976b1adc
Author: Kevin P Schoedel <kevin.p.schoedel@intel.com>
Reviewed-by: Edwin Vane <edwin.vane@intel.com>
2012-08-21 15:28:23 -04:00
Ard Biesheuvel
5ed48a4d7f ARM: make sure __on_dlclose() actually gets called
Change-Id: I280e5428b0543cccf17ca36baee4865395928cdb
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-21 12:56:05 +02:00
Andrew Hsieh
5cd1efb2ba am 1bd035cf: Merge "Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS"
* commit '1bd035cf119a2e4a667f07907c7860e5ec223cee':
  Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS
2012-08-21 03:29:14 -07:00
Andrew Hsieh
1bd035cf11 Merge "Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS" 2012-08-21 03:25:46 -07:00
Andrew Hsieh
2f7d7c6538 Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS
Those are C funcitons

Related CL: https://android-review.googlesource.com/#/c/41833/

Change-Id: I4386bcf948ad31c3690c9b7a145103088133d041
2012-08-21 15:41:34 +08:00
Ian Rogers
8af726b24f am 7b0d9b79: Merge "Restore posix_memalign"
* commit '7b0d9b798474ab62d4bf67c79ae901f4c4789f27':
  Restore posix_memalign
2012-08-20 19:43:15 -07:00
Ian Rogers
7b0d9b7984 Merge "Restore posix_memalign" 2012-08-20 19:35:25 -07:00
Brian Carlstrom
bfc1d97531 Restore posix_memalign
Change-Id: I24e31bcb8b1d8be9375852e76964f09becd11938
2012-08-20 19:25:39 -07:00
Brian Carlstrom
fe87596a5b am c37dcd3d: Merge "Upgrade to dlmalloc 2.8.5."
* commit 'c37dcd3d3ab8e32c37ce034b8d1772b4a7b9add9':
  Upgrade to dlmalloc 2.8.5.
2012-08-20 16:29:48 -07:00
Brian Carlstrom
c37dcd3d3a Merge "Upgrade to dlmalloc 2.8.5." 2012-08-20 16:12:33 -07:00
Ian Rogers
999089181e Upgrade to dlmalloc 2.8.5.
Move dlmalloc code to upstream-dlmalloc to make pulling upstream changes
easier.
Declare pvalloc and malloc_usable_size routines present in malloc.h but with
missing implementations. Remove other functions from malloc.h that have
no implementation nor use in Android.

Change-Id: Ia6472ec6cbebc9ad1ef99f4669de9d33fcc2efb4
2012-08-20 14:12:20 -07:00
Elliott Hughes
2651d6c6cb am 9417a80e: Merge "Always define the 64-bit int types."
* commit '9417a80e48d3bba4bea814178aaa79b905ebab8c':
  Always define the 64-bit int types.
2012-08-17 16:56:14 -07:00
Elliott Hughes
9417a80e48 Merge "Always define the 64-bit int types." 2012-08-17 16:48:14 -07:00
Elliott Hughes
cbeccc849a am 200de748: Merge "Fix race condition in pthread_create()"
* commit '200de748b91d7638a2c434584abcb3840704494b':
  Fix race condition in pthread_create()
2012-08-17 16:23:53 -07:00
Elliott Hughes
200de748b9 Merge "Fix race condition in pthread_create()" 2012-08-17 16:19:56 -07:00
Jurijs Oniscuks
2932f04832 Fix race condition in pthread_create()
Save thread id to *thread_out before new
thread is allowed to run else there's a
risk that the thread has finished and
been deleted when *thread_out is assigned.

Change-Id: I6b84c61a8df06840877d4ab036f26feace3192d8
2012-08-17 16:18:32 -07:00
Elliott Hughes
6d6731adc0 Always define the 64-bit int types.
These preprocessor tricks have caused trouble for -std=gnu99 and -ansi, and
both netbsd's libc and glibc seem to unconditionally define these types.

Change-Id: Ib8dffa341a8ca88f80d275ba2b7f93a4c910ee32
2012-08-17 14:30:06 -07:00
Elliott Hughes
e5242bfdd7 am 1771a33d: Merge "Add link.h for all platforms with dl_phdr_info"
* commit '1771a33d11a24f1c47b1ef75e3726c5d9e751f5b':
  Add link.h for all platforms with dl_phdr_info
2012-08-17 14:00:11 -07:00
Elliott Hughes
1771a33d11 Merge "Add link.h for all platforms with dl_phdr_info" 2012-08-17 13:54:43 -07:00
Pavel Chupin
b7beb69075 Add link.h for all platforms with dl_phdr_info
This header is used on bionic build and should be propagated into
sysroot on toolchain rebuild. Discussion re. this header is here:
http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00936.html

It is available already in mips NDK platforms:
development/ndk/platforms/android-9/arch-mips/include/link.h

Change-Id: I39ff467cdac9f448e31c11ee3e14a6200e82ab57
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2012-08-17 12:44:23 -07:00
Henrik Engström
ce5ba8bfcd Added missing cache failed notification
Added a missing call to _resolv_cache_query_failed for another fail
case where it was missing (it doesn't go through the error handling
under the "fail" label). This missing notification caused requests to
have to wait for timeout instead of beeing notified on some failed
requests.

Change-Id: I904d60269c59b926784e3a397d2a860329f55142
2012-08-17 09:18:47 +02:00
Joe Onorato
cefb93b632 am 6c98cdb1: Merge "Don\'t over-generalize makefiles. Host modules always build. This isn\'t needed on eng builds."
* commit '6c98cdb1924afd3e71d39904557933fa10adaebf':
  Don't over-generalize makefiles.  Host modules always build. This isn't needed on eng builds.
2012-08-16 23:50:35 -07:00
Joe Onorato
6c98cdb192 Merge "Don't over-generalize makefiles. Host modules always build. This isn't needed on eng builds." 2012-08-16 23:37:50 -07:00
Joe Onorato
7b841f3b4a Don't over-generalize makefiles. Host modules always build. This isn't needed on eng builds.
Change-Id: I5821ced7a8a9042fd2094204e07470d8002263ca
2012-08-16 22:36:36 -07:00
Elliott Hughes
c80ca54f3c am 60ef95e1: Merge "Enhance getcwd(3) to handle NULL like glibc."
* commit '60ef95e1c1b171635adb4d11289347674b1b8987':
  Enhance getcwd(3) to handle NULL like glibc.
2012-08-16 17:04:11 -07:00
Elliott Hughes
60ef95e1c1 Merge "Enhance getcwd(3) to handle NULL like glibc." 2012-08-16 16:58:34 -07:00
Elliott Hughes
04a83a48ed Enhance getcwd(3) to handle NULL like glibc.
Bug: http://code.google.com/p/android/issues/detail?id=36085
Change-Id: I960a1b585887eb66176c61d29c5c61c239a4003f
2012-08-16 15:59:12 -07:00
Elliott Hughes
74438bb225 am 449d4634: Merge "bionic: add macro protection for MALLOC_ALIGNMENT"
* commit '449d4634bea0ff8f6b29a2826871279dd654f941':
  bionic: add macro protection for MALLOC_ALIGNMENT
2012-08-16 12:27:47 -07:00
Elliott Hughes
449d4634be Merge "bionic: add macro protection for MALLOC_ALIGNMENT" 2012-08-16 12:09:13 -07:00