[gccsdk] Patching as/objasm to allow expressions with record layouts
Christopher Martin
belles at internode.on.net
Mon Sep 28 07:23:28 PDT 2009
There appears to have been a longstanding issue with the as/objasm
assembler included in GCC 3 and 4 for RISC OS. In short, many
expressions that included symbols defined in record layouts could not be
evaluated.
I have attached a ZIP archive containing a tiny file, <test.s>, that
demonstrates the problem; assembly fails at line 19.
I have also included a diff file that shows my single-line addition to
<objasm/storage.c> that resolves the problem. The patch applies to the
online sources in <gccsdk-riscos-tools-src-4.1.1-rel1b.zip>.
I hope this helps. Of course, it will make no difference to GCC C/C++
compilations. But it does matter for some libraries of hand-crafted
assembly functions.
--
Regards, Chris.
-------------- next part --------------
--- downloaded.objasm.c.storage
+++ patched.objasm.c.storage
@@ -88,6 +88,7 @@ c_alloc (Symbol * sym)
sym->type |= SYMBOL_ABSOLUTE | SYMBOL_DEFINED;
sym->area.ptr = NULL;
sym->value = storageValue ();
+ sym->value.Tag.t = ValueInt;
}
exprBuild ();
value = exprEval (ValueInt);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_layout.zip
Type: application/compress
Size: 1180 bytes
Desc: not available
URL: <http://www.riscos.info/pipermail/gcc/attachments/20090928/55ecd87c/attachment.bin>
More information about the gcc
mailing list