From 906dbea2b4120ebc4113b4faf81d789ef04ea7b2 Mon Sep 17 00:00:00 2001
From: Dima Zavin <dima@android.com>
Date: Wed, 22 Feb 2012 15:18:54 -0800
Subject: [PATCH 1/3] libc: Add __aeabi_llsl and __aeabi_llsr to libgcc_compat

Some platform libraries built for ICS do not work with master
because of some refactoring in frameworks/base.

Make sure that these libgcc symbols are always present in our libc

Change-Id: Ib8d345878be0ba711f051082a778f5cc1f1b3a19
Signed-off-by: Dima Zavin <dima@android.com>
---
 libc/arch-arm/bionic/libgcc_compat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libc/arch-arm/bionic/libgcc_compat.c b/libc/arch-arm/bionic/libgcc_compat.c
index d184566c9..1a1970103 100644
--- a/libc/arch-arm/bionic/libgcc_compat.c
+++ b/libc/arch-arm/bionic/libgcc_compat.c
@@ -113,6 +113,8 @@
     XX(__aeabi_l2d)          \
     XX(__aeabi_l2f)          \
     XX(__aeabi_lmul)         \
+    XX(__aeabi_llsl)         \
+    XX(__aeabi_llsr)         \
     XX(__aeabi_ui2d)         \
     XX(__aeabi_ui2f)         \
     XX(__aeabi_ul2d)         \

From 93b8f941f2de1bd110265dd7585710ac30548928 Mon Sep 17 00:00:00 2001
From: Kenny Root <kroot@google.com>
Date: Fri, 24 Feb 2012 11:04:42 -0800
Subject: [PATCH 2/3] Revert "Use the new NativeDaemonConnector style."

The other changes relating to this were already reverted.

This reverts commit 1625c7a837d73b6729f97edb32c497d289c0220c
---
 libc/netbsd/net/getaddrinfo.c | 2 +-
 libc/netbsd/net/getnameinfo.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/netbsd/net/getaddrinfo.c b/libc/netbsd/net/getaddrinfo.c
index 6aee69741..6ae6e3e43 100644
--- a/libc/netbsd/net/getaddrinfo.c
+++ b/libc/netbsd/net/getaddrinfo.c
@@ -461,7 +461,7 @@ android_getaddrinfo_proxy(
 
 	// Send the request.
 	proxy = fdopen(sock, "r+");
-	if (fprintf(proxy, "0 getaddrinfo %s %s %d %d %d %d",
+	if (fprintf(proxy, "getaddrinfo %s %s %d %d %d %d",
 		    hostname == NULL ? "^" : hostname,
 		    servname == NULL ? "^" : servname,
 		    hints == NULL ? -1 : hints->ai_flags,
diff --git a/libc/netbsd/net/getnameinfo.c b/libc/netbsd/net/getnameinfo.c
index 313b2bf36..d3d0011b9 100644
--- a/libc/netbsd/net/getnameinfo.c
+++ b/libc/netbsd/net/getnameinfo.c
@@ -187,7 +187,7 @@ android_gethostbyaddr_proxy(struct hostent* hp, const void *addr, socklen_t addr
 	if (addrStr == NULL) {
 		goto exit;
 	}
-	if (fprintf(proxy, "0 gethostbyaddr %s %d %d", addrStr, addrLen, addrFamily) < 0) {
+	if (fprintf(proxy, "gethostbyaddr %s %d %d", addrStr, addrLen, addrFamily) < 0) {
 		goto exit;
 	}
 

From fa3f72ee53ba79e41b78fa178ef8bb9372e2c084 Mon Sep 17 00:00:00 2001
From: Kenny Root <kroot@google.com>
Date: Mon, 5 Mar 2012 10:45:31 -0800
Subject: [PATCH 3/3] Revert "Reference __dso_handle in PIC way"

This reverts commit 93cb30813764b140f0adbaa620dcdbb1cae56dd8
---
 libc/arch-arm/bionic/crtbegin_so.S | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/libc/arch-arm/bionic/crtbegin_so.S b/libc/arch-arm/bionic/crtbegin_so.S
index 8123254ea..9275b1e01 100644
--- a/libc/arch-arm/bionic/crtbegin_so.S
+++ b/libc/arch-arm/bionic/crtbegin_so.S
@@ -34,18 +34,17 @@
 # standard.
 #
 __on_dlclose:
-        ldr     r0, .L1
-.LPIC0:
-        add     r0, pc
+        adr     r0, 0f
         ldr     r0, [r0]
         b       __cxa_finalize
-.L1:
-        .word   __dso_handle-(.LPIC0+4)
 
-        .section .init_array, "aw"
-        .globl __INIT_ARRAY__
+0:
+        .long   __dso_handle
+
+	.section .init_array, "aw"
+	.globl __INIT_ARRAY__
 __INIT_ARRAY__:
-        .long -1
+	.long -1
 
         .section .fini_array, "aw"
         .globl __FINI_ARRAY__