]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/tools/toolutil/pkg_genc.c
ICU-551.24.tar.gz
[apple/icu.git] / icuSources / tools / toolutil / pkg_genc.c
index f6d1d8b590c00423ecab8b5bea0508b6bc4ddc64..3096db87f873d3c3586e4b35dc5cb2c437170e90 100644 (file)
@@ -1,5 +1,5 @@
 /******************************************************************************
- *   Copyright (C) 2009-2013, International Business Machines
+ *   Copyright (C) 2009-2015, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  *******************************************************************************
  */
@@ -112,14 +112,17 @@ static const struct AssemblyType {
     const char *footer;
     int8_t      hexType; /* HEX_0X or HEX_0h */
 } assemblyHeader[] = {
-    // For gcc assemblers, the meaning of .align changes depending on the
-    // hardware, so we use .balign 16 which always means 16 bytes.
-    // https://sourceware.org/binutils/docs/as/Pseudo-Ops.html
+    /* For gcc assemblers, the meaning of .align changes depending on the */
+    /* hardware, so we use .balign 16 which always means 16 bytes. */
+    /* https://sourceware.org/binutils/docs/as/Pseudo-Ops.html */
     {"gcc",
         ".globl %s\n"
         "\t.section .note.GNU-stack,\"\",%%progbits\n"
         "\t.section .rodata\n"
-        "\t.balign 16\n" 
+        "\t.balign 16\n"
+        "#ifdef U_HIDE_DATA_SYMBOL\n"
+        "\t.hidden %s\n"
+        "#endif\n"
         "\t.type %s,%%object\n"
         "%s:\n\n",
 
@@ -129,6 +132,9 @@ static const struct AssemblyType {
         /*"\t.section __TEXT,__text,regular,pure_instructions\n"
         "\t.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32\n"*/
         ".globl _%s\n"
+        "#ifdef U_HIDE_DATA_SYMBOL\n"
+        "\t.private_extern _%s\n"
+        "#endif\n"
         "\t.data\n"
         "\t.const\n"
         "\t.balign 16\n"
@@ -152,8 +158,8 @@ static const struct AssemblyType {
 
         ".long ","",HEX_0X
     },
-// 16 bytes alignment.
-// http://docs.oracle.com/cd/E19641-01/802-1947/802-1947.pdf
+/* 16 bytes alignment. */
+/* http://docs.oracle.com/cd/E19641-01/802-1947/802-1947.pdf */
     {"sun",
         "\t.section \".rodata\"\n"
         "\t.align   16\n"
@@ -162,8 +168,8 @@ static const struct AssemblyType {
 
         ".word ","",HEX_0X
     },
-// 16 bytes alignment for sun-x86.
-// http://docs.oracle.com/cd/E19963-01/html/821-1608/eoiyg.html
+/* 16 bytes alignment for sun-x86. */
+/* http://docs.oracle.com/cd/E19963-01/html/821-1608/eoiyg.html */
     {"sun-x86",
         "Drodata.rodata:\n"
         "\t.type   Drodata.rodata,@object\n"
@@ -174,8 +180,8 @@ static const struct AssemblyType {
 
         ".4byte ","",HEX_0X
     },
-// 1<<4 bit alignment for aix.
-// http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.aixassem%2Fdoc%2Falangref%2Fidalangref_csect_pseudoop.htm
+/* 1<<4 bit alignment for aix. */
+/* http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.aixassem%2Fdoc%2Falangref%2Fidalangref_csect_pseudoop.htm */
     {"xlc",
         ".globl %s{RO}\n"
         "\t.toc\n"
@@ -204,8 +210,8 @@ static const struct AssemblyType {
 
         ".WORD ","",HEX_0X
     },
-// align 16 bytes
-//  http://msdn.microsoft.com/en-us/library/dwa9fwef.aspx
+/* align 16 bytes */
+/*  http://msdn.microsoft.com/en-us/library/dwa9fwef.aspx */
     { "masm",
       "\tTITLE %s\n"
       "; generated by genccode\n"
@@ -264,7 +270,7 @@ writeAssemblyCode(const char *filename, const char *destdir, const char *optEntr
         exit(U_FILE_ACCESS_ERROR);
     }
 
-    getOutFilename(filename, destdir, bufferStr, entry, ".s", optFilename);
+    getOutFilename(filename, destdir, bufferStr, entry, ".S", optFilename);
     out=T_FileStream_open(bufferStr, "w");
     if(out==NULL) {
         fprintf(stderr, "genccode: unable to open output file %s\n", bufferStr);
@@ -761,7 +767,7 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char
 U_CAPI void U_EXPORT2
 writeObjectCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optMatchArch, const char *optFilename, char *outFilePath) {
     /* common variables */
-    char buffer[4096], entry[40]={ 0 };
+    char buffer[4096], entry[96]={ 0 };
     FileStream *in, *out;
     const char *newSuffix;
     int32_t i, entryLength, length, size, entryOffset=0, entryLengthOffset=0;