Tuesday, 15 September 2015

Re: [gccsdk] no main

In message <55F7E5F4.1000002@sky.com>
Lee Noar <leenoar@sky.com> wrote:

>Does the interpreter reference these two symbols directly rather than
>via dlsym?
>
>Lee.

No - absolutely not. Nor should dlsym.

When a pack of object files are linked I would expect that the internal references
are resolved, and any other references are taken to be external, and hence
to be put into a table in the resulting elf output for later resolution.
Is that how gcc is supposed to function? Or does gcc need extra information
about which symbols are to be considered local and which global?
In my mind's eye I have a picture of a labelled directed graph, the vertices being
object files, the arrows being labelled by symbols, referenced in the source
vertex and exported within the target vertex. Is that a sensible picture?
Any symbol not referenced from within the graph has to be external, and
anything that is has to be internal.

I think sys.s has only one symbol not referenced by riscoslib.c - I might as
well delete it. No symbols in sys.s are referenced by anything outside sys.s
except from riscoslib.c. In particular sys.s makes no references to
anything in liblua or the C libraries. It imports nothing.
Am I right in thinking that I can write assembler directly into C source
with GCC? That might simplify these linkage problems.
There are very few lines of it - especially in relation to the trouble they
seem to be causing ;). There is no other way of giving RiscLua access to
RISC OS SWIs, of course. Using the Norcroft compiler I had to use Objasm
but perhaps GCC offers more flexible alternatives?

--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment