This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Porting binutils to Amiga Unix
- From: Nick Clifton <nickc at redhat dot com>
- To: Mack Wallace <mackbw at mapinternet dot com>
- Cc: binutils at sourceware dot org, Andreas Schwab <schwab at linux-m68k dot org>, Kai Ruottu <kai dot ruottu at wippies dot com>
- Date: Tue, 11 Apr 2017 08:55:17 +0100
- Subject: Re: Porting binutils to Amiga Unix
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nickc at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C4CCC3D967
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C4CCC3D967
- References: <CFEDEDC3-E90C-4048-8141-A6A709B51861@mapinternet.com> <87y3x6v4wj.fsf@linux-m68k.org> <9FF46D3D-8C81-4787-9806-DC1BE36FDD50@mapinternet.com>
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
example:
#ifdef AMIGA_UNIX
{ "aligned_lcomm", s_lcomm_bytes, 1 },
#endif
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.
Cheers
Nick