Common areas and as

David Marston david at illudium.org.uk
Fri Oct 24 13:50:49 PDT 2003


Nick Burrett wrote:

> David Marston wrote:
> 
> > I have actually managed to compile everything by changing
> > ASM_OUTPUT_COMMON to generate Common areas again (with individual
> > names), and by ASM_OUTPUT_BSS generating exactly the same thing,
> > but I'd prefer some more time to read the GCC internals
> > documentation (scary) or some thoughts from someone who
> > understands GCC (Nick) before suggesting we do this. (This
> > actually changes the ASM_OUTPUT_COMMON macro back to what it was
> > around version 1.8 BTW).
> 
> You've come across exactly the same problem that I was trying to
> solve before I reported the problem with 'as' and common areas. I'll
> look at it on Saturday.

Yes, I thought about it some more later and realised you were right to
begin with, you can get away with just the area names now they're
exported as symbols. The mistake I made was trying to fix the libfile
problem by changing ASM_OUTPUT_COMMON when I think it was actually
ASM_OUTPUT_BSS that was the problem.

Anyway, as a starting point for you looking at it tomorrow, these
definitions work for libfile (recompiling everything necessary). I'll
do a full recompile of everything in the morning (it takes about 3
hours on my 2.4GHz machine!), but I'm fairly confident it should work.
(Yes, they are both the same)


#define ASM_OUTPUT_COMMON(STREAM,NAME,SIZE,ROUNDED)		\
  do								\
    {								\
     common_section ();						\
     fprintf ((STREAM), "\tAREA |%s|, DATA, COMMON\n", (NAME));	\
     fprintf ((STREAM), "\tEXPORT |%s|\n", (NAME));		\
     fprintf ((STREAM), "\t%% %d\t%s size=%d\n",		\
	      (ROUNDED), ASM_COMMENT_START, (SIZE));		\
     aof_delete_import ((NAME));				\
    }								\
  while (0)
  
#define ASM_OUTPUT_BSS(STREAM,DECL,NAME,SIZE,ROUNDED)		\
  do								\
    {								\
     common_section ();						\
     fprintf ((STREAM), "\tAREA |%s|, DATA, COMMON\n", (NAME));	\
     fprintf ((STREAM), "\tEXPORT |%s|\n", (NAME));		\
     fprintf ((STREAM), "\t%% %d\t%s size=%d\n",		\
	      (ROUNDED), ASM_COMMENT_START, (SIZE));		\
     aof_delete_import ((NAME));				\
    }								\
  while (0)
  

PS: Sorry if I've broken the threading, I didn't have the original
message on this machine.
-- 




More information about the gcc mailing list