"Pierre d'Herbemont" stegefin@free.fr writes:
+# define LD_SKIP(i)
This won't work, we need to reserve space for the PE header.
+# define PPC_SYM(sym_name) "_" #sym_name
This one should use __ASM_NAME.
Also it would be nice if you could use fewer macros, this makes the code quite ugly. It seems the main difference is in register names, you could simply have one macro for that and leave the rest alone.
On Friday, June 27, 2003, at 11:50 PM, Alexandre Julliard wrote:
"Pierre d'Herbemont" stegefin@free.fr writes:
+# define LD_SKIP(i)
This won't work, we need to reserve space for the PE header.
I don't know if there is a skip instruction in Mach-O Format. I'll try to fix this.
+# define PPC_SYM(sym_name) "_" #sym_name
This one should use __ASM_NAME.
Hum... If my memory is well I do use PPC_SYM in order to convert delay_imports to _delay_imports on darwin target. the assembler syntax requires it.
Also it would be nice if you could use fewer macros, this makes the code quite ugly. It seems the main difference is in register names, you could simply have one macro for that and leave the rest alone.
If you want, but for me it seems that it is clearer this way. because you endup with things like: fprintf((output," "li " PPC_REG(1) ", 0\n"\n"); fprintf(outfile, "\t"\tlis " PC_REG(9) PPC_LOW(delay_imports+%d,9)\n"\n", pos); But in fact it is also readable. If you prefer this way I'll do what you like ;)
Thanks,
Pierre
"Pierre d'Herbemont" stegefin@free.fr writes:
Hum... If my memory is well I do use PPC_SYM in order to convert delay_imports to _delay_imports on darwin target. the assembler syntax requires it.
Yes, that's exactly what __ASM_NAME is supposed to do.
If you want, but for me it seems that it is clearer this way. because you endup with things like: fprintf((output," "li " PPC_REG(1) ", 0\n"\n"); fprintf(outfile, "\t"\tlis " PC_REG(9) PPC_LOW(delay_imports+%d,9)\n"\n", pos); But in fact it is also readable. If you prefer this way I'll do what you like ;)
IMO it would be more readable with a separate function, and then something like:
fprintf( output, "li %s,0", ppc_reg(1) );