diff mbox

[android/bionic,3/3] Hide libm private symbols using GCC visibility pragma

Message ID BANLkTikNyaWDzx_aqvV_JGXPe_YtjszZBQ@mail.gmail.com
State New
Headers show

Commit Message

Jim Huang April 19, 2011, 9:16 p.m. UTC
Following the visibility changes in libc.so, this patch attempts to hide
private symbols in libm.so.

Reference code size measurements for HTC Passion:
$ arm-eabi-size out/target/product/passion/system/lib/libm.so

[before]
   text    data     bss     dec     hex filename
  88423     256      32   88711   15a87
out/target/product/passion/system/lib/libm.so

[after]
   text    data     bss     dec     hex filename
  87950     256      32   88238   158ae
out/target/product/passion/system/lib/libm.so

Code Review:
    https://review.source.android.com/#change,17358
diff mbox

Patch

From 331af85e9694c4c9247e39716f97ede1a62ee9ce Mon Sep 17 00:00:00 2001
From: Jim Huang <jim.huang@linaro.org>
Date: Wed, 20 Apr 2011 05:02:10 +0800
Subject: [PATCH] Hide libm private symbols using GCC visibility pragma

Following the visibility changes in libc.so, this patch attempts to hide
private symbols in libm.so.

Reference code size measurements for HTC Passion:
$ arm-eabi-size out/target/product/passion/system/lib/libm.so

[before]
   text	   data	    bss	    dec	    hex	filename
  88423	    256	     32	  88711	  15a87	out/target/product/passion/system/lib/libm.so

[after]
   text	   data	    bss	    dec	    hex	filename
  87950	    256	     32	  88238	  158ae	out/target/product/passion/system/lib/libm.so

Change-Id: I51841a9f5d7b7663b95ebf5c1bd17d1ec9a6c1b6
---
 libm/src/math_private.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libm/src/math_private.h b/libm/src/math_private.h
index 5f6e088..8c9f04f 100644
--- a/libm/src/math_private.h
+++ b/libm/src/math_private.h
@@ -20,6 +20,8 @@ 
 #include <sys/types.h>
 #include <endian.h>
 
+#include <sys/cdefs_hidden_push.h>
+
 /*
  * The original fdlibm code used statements like:
  *	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
@@ -270,4 +272,6 @@  float	__kernel_cosdf(double);
 float	__kernel_tandf(double,int);
 int	__kernel_rem_pio2f(float*,float*,int,int,int,const int*);
 
+#include <sys/cdefs_hidden_pop.h>
+
 #endif /* !_MATH_PRIVATE_H_ */
-- 
1.7.4.1