This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add missing ARM CLIBABI variables __aeabi_std*


The ARM EABI has a document CLIBABI specifying various __aeabi_* functions 
and variables to be provided for the use of portable objects that can be 
linked with different EABI-conforming C libraries.  glibc provided most of 
these (as hidden static-only symbols in the case of the variables) but was 
missing __aeabi_stdin, __aeabi_stdout and __aeabi_stderr; I've applied 
this patch to add these.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index dbc00f6..ebc4e30 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,9 @@
+2009-06-25  Nathan Froyd  <froydnj@codesourcery.com>
+
+	* sysdeps/arm/eabi/aeabi_lcsts.c (__aeabi_stdin, __aeabi_stdout,
+	__aeabi_stderr): New variables.
+	(setup_aeabi_stdio): New function.  Add it to .preinit_array.
+
 2009-06-24  Maxim Kuvyrkov  <maxim@codesourcery.com>
             Mark Mitchell  <mark@codesourcery.com>
             Joseph Myers  <joseph@codesourcery.com>
diff --git a/sysdeps/arm/eabi/aeabi_lcsts.c b/sysdeps/arm/eabi/aeabi_lcsts.c
index 99c7985..0c620d4 100644
--- a/sysdeps/arm/eabi/aeabi_lcsts.c
+++ b/sysdeps/arm/eabi/aeabi_lcsts.c
@@ -81,4 +81,19 @@ eabi_constant (TMP_MAX);
 eabi_constant (FILENAME_MAX);
 eabi_constant (L_tmpnam);
 
+FILE *__aeabi_stdin attribute_hidden;
+FILE *__aeabi_stdout attribute_hidden;
+FILE *__aeabi_stderr attribute_hidden;
+
+static void __attribute__ ((used))
+setup_aeabi_stdio (void)
+{
+  __aeabi_stdin = stdin;
+  __aeabi_stdout = stdout;
+  __aeabi_stderr = stderr;
+}
+
+static void (*fp) (void) __attribute__ ((used, section (".preinit_array")))
+  = setup_aeabi_stdio;
+
 eabi_constant (CLOCKS_PER_SEC);

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]