This is the mail archive of the mailing list for the binutils 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]

Re: Porting binutils to Amiga Unix

Hi Mack,

> compilation seems to error out on lines where there is a third argument to .lcomm. 

> So my question is, is the problem with by build of gnu as?

Yes and no, see below.

> Or is the problem with gcc building code with an alignment argument?

Well the simplest solution would be to omit the alignment argument.  Then you will
not have to make any changes to gnu as.

The GNU assembler does support a .lcomm directive with three arguments, but only
for certain targets.  Unfortunately the m68k is not one of these targets.  So in
order to fix your problem and have aligned entries in the .bss section you are 
going to have to modify the assembler sources.

Specifically you should find the definition of md_pseudo_table in gas/config/tc-m68k.c
and add entry that reads:

   { "lcomm", s_lcomm_bytes, 1 },
Assuming that you want the alignment parameter to be a power of two, or:

   { "lcomm", s_lcomm_bytes, 2 },
If you want the alignment power to be a number of bytes.  (Yes the sense of the
numbers is reversed.  No, I do not know why... :-)

Recompile and off you go.

BUT .. this would be a change that would affect all forms of the m68k assembler,
which would be a bad thing.  So either you need to protect this new definition with
a #ifdef ... #endif specific to the Amiga Unix port of the assembler, or else you
need to invent a new name for the pseudo-op and use that instead.  Or both.  For 

   { "aligned_lcomm", s_lcomm_bytes, 1 },

Of course if you use a new name, then you will have to update the definition of 
BSS_ASM_OP for gcc as well.

I hope that this makes sense.


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