Menu

#1347 Link error, no message.

closed-rejected
linker (61)
5
2014-08-23
2007-06-19
Bruce
No

Hi,

Using checklist numbering from above:

1) Attached is PossibleLinkError.zip. It contains two sub .zip files. The first is sdccLinkError.zip. The second is sdccNoLinkError.zip.

Each sub .zip files contains complete source to the project I'm working on.

Only two files are changed between the 'LinkError' and 'NoLinkError', one line each. The following is a 'diff' report:

C:\awork\24InchPig\Firmware\FlashCard\bootLoader>diff Makefile ..\sdccLinkError\ Makefile
13c13
< OBJECT_FILES = main.rel hardware.rel timers.rel
---
> OBJECT_FILES = main.rel hardware.rel timers.rel uarts.rel

C:\awork\24InchPig\Firmware\FlashCard\bootLoader>diff hardware.c ..\sdccLinkError\hardware.c
114c114
< // InitializeUart0();
---
> InitializeUart0();

I.e. The link fails when uarts.rel is linked in. It works OK when it isn't.

The only reference to uarts.rel is the call to InitializeUart0() from hardware.c (which is commented out in sdccNoLinkError.zip).

The linker reports no error message, but it returns an error value of -1 as if there was an error, aborting the make:

sdcc --debug --main-return --use-stdout -V main.rel hardware.rel timers.rel uar
ts.rel -o bootLoader.ihx
gmake.exe: *** [bootLoader.ihx] Error -1

2) To run sdcc on this project, run GNU Make. (I'm using version 3.76.1 here.)

3) SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.7.0 #4818 (May 31 2007) (MINGW32)

4) See #1 above.

5) Contact:Bruce@Emtek.us. or 480-444-8974

Thank You!

Bruce Olney

Discussion

  • Bruce

    Bruce - 2007-06-19

    Contains two projects. One demonstrates error, the other doesn't.

     
  • Bruce

    Bruce - 2007-06-19

    Logged In: YES
    user_id=1814827
    Originator: YES

    P.S. I'm using Windows XP with all the latests updates.

     
  • Maarten Brock

    Maarten Brock - 2008-04-17

    Logged In: YES
    user_id=888171
    Originator: NO

    Bruce,

    I ran make with SDCC 2.8.0 and it nicely generated this error message:

    ?ASlink-Warning-Undefined Global '_InitializeUart0' referenced by module 'hardware'
    + C:\Programs\SDCC\bin\aslink.exe -nf "bootLoader.lnk" returned errorcode 2
    make: *** [bootLoader.ihx] Error 1

    Looking in your uarts.c I see everything #ifdef'ed out, so no surprise here.

    Maybe something (Codewright?) is suppressing the output on stderr? Try --use-stdout so all output will be sent to stdout instead of stderr.

     
  • Maarten Brock

    Maarten Brock - 2008-04-17
    • milestone: --> unreproducable
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-rejected
     

Log in to post a comment.