gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] A burst of internal compiler issues from gm2-6.4.0 when linkin


From: Gaius Mulley
Subject: Re: [Gm2] A burst of internal compiler issues from gm2-6.4.0 when linking a stand-alone application
Date: Wed, 22 Nov 2017 10:19:07 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

John Dubery <address@hidden> writes:

> Gaius,
> I've encountered a strange set of messages when doing the link of a
> set of modules for stand-alone use. There are two types of message.
>
> 1. MOD and DIV
> I get 4 messages differing by the address only for one occurrence each
> of MOD and DIV in a sub-module:
> ScreenTest.mod:(.text+0xb54): undefined reference to `__aeabi_ldivmod'
> The first line is:
> ScreenTest.o: In function `RPiGPIOControl_FlashNumber':
> which is where the MOD and DIV are but there is also a MOD in the main
> module that doesn't trigger this message.
>
> 2. Undefined references to labels that I don't use.
> A message similar to this:
>
>     /home/jd4/opt/lib/gcc//arm-linux-gnueabihf/6.4.0/libgcc_eh.a
>     (unwind-arm.o): In function `unwind_phase2':
>     
> /home/jd4/GM2/build-6.4.0/arm-linux-gnueabihf/libgcc/../../../gcc-6.4.0+gm2-git-latest/gm2/gcc-versionno/libgcc/unwind-arm-common.inc:289:
>     undefined reference to `abort'
>     
>
> occurs for several labels:
> __exidx_end
> __exidx_start
> memcpy twice
> abort 4 times
>
> The occurrences with abort do indeed have this label/function called
> at the specified place and file. But memcpy does not appear in the
> file listed in its error messages.
>
> The compilation step is:
> gm2 -nostartfiles -fno-exceptions -fno-pth -fm2-whole-program -
> flibs=min -c ScreenTest.mod
>
> The link step is:


Hi John,

>     gm2 -static -nostdlib -nostartfiles -fno-exceptions -fno-pth -
>     fm2-whole-program -flibs=min -fonlylink -TSimple.ld ScreenTest.o
>     ScreenTest-start.o -o ScreenTest.elf

gm2 needs the source file of the top program module as well on the
command line.  It uses this to generate the scaffold of module calls for
all dependant modules (the order can be overwritten by you if
necessary).

It might be worth trying:

$ gm2 -static -nostdlib -nostartfiles -fno-exceptions -fno-pth -
  fm2-whole-program -flibs=min -fonlylink -TSimple.ld ScreenTest.o
  ScreenTest-start.o -o ScreenTest.elf -v  ScreenTest.mod

regards,
Gaius

> Simple.ld is very simple. It has .init, .text, .data, .bss and
> discards for everything else.
>
> I feel I must have made a simple mistake. Can you point me in the
> right direction?

>
> Regards,
> John
>
> _______________________________________________
> gm2 mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/gm2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]