PATCH: Include <link.h> only if USE_PT_GNU_EH_FRAME is defined

H.J. Lu hongjiu.lu@intel.com
Tue Sep 7 17:18:00 GMT 2010


Hi,

Bionic C library doesn't have <link.h>.  But it uses
unwind-dw2-fde-glibc.c.  This patch includes <link.h> only if it is
really needed.  OK for trunk?

Thanks.


H.J.
---
2010-09-07  H.J. Lu  <hongjiu.lu@intel.com>

	* unwind-dw2-fde-glibc.c: Include <elf.h> for DT_CONFIG.
	Include <link.h> only if USE_PT_GNU_EH_FRAME is defined.

diff --git a/gcc/unwind-dw2-fde-glibc.c b/gcc/unwind-dw2-fde-glibc.c
index b8a7312..a762d87 100644
--- a/gcc/unwind-dw2-fde-glibc.c
+++ b/gcc/unwind-dw2-fde-glibc.c
@@ -33,7 +33,7 @@
 #include "tconfig.h"
 #include "tsystem.h"
 #ifndef inhibit_libc
-#include <link.h>
+#include <elf.h>		/* Get DT_CONFIG.  */
 #endif
 #include "coretypes.h"
 #include "tm.h"
@@ -59,6 +59,8 @@
 
 #if defined(USE_PT_GNU_EH_FRAME)
 
+#include <link.h>
+
 #ifndef __RELOC_POINTER
 # define __RELOC_POINTER(ptr, base) ((ptr) + (base))
 #endif



More information about the Gcc-patches mailing list