/******************************************************************************
- * Copyright (C) 2009-2013, International Business Machines
+ * Copyright (C) 2009-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
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",
/*"\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"
".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"
".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"
".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"
".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"
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);
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;