Menu

#2238 sdranlib doesn't seem to handle --debug .rel files

closed-fixed
Ben Shi
None
Tools
5
2019-12-30
2013-12-29
No

Experimenting with --debug using

SDCC : z80 3.3.1 #8894 (Oct 14 2013) (Solaris i386)

If I build my project files into libraries using:
/sw/bin/sdcc --debug -mz80 --fverbose-asm -I../include -mz80 --fverbose-asm -I../../include -c -o foo.rel foo.c
/usr/bin/ar -crS foo.lib foo.rel
/sw/bin/sdranlib foo.lib

I get the following error:

BFD: foo.lib(foo.rel):2: Unexpected character `X' in asxxxx .rel file

Eventually, the final link fails with unresolved symbols. There is one error for every file which was produced using "sdcc --debug". Hand-generated assembler files do not exhibit this problem. It seems to be complaining about the "XL2" line. However, as this line is normally in the .rel files, I'd speculate that sdranlib is assuming line 1 is XL2, where in the --debug output .rel file, we get:

==========
;!FILE thread.asm
XL2
H 9 areas 241 global symbols
M thread
O -mz80
<snip>
==========

Removing the first line from every .rel file allows sdranlib to complete with no errors.
I haven't included a specific example as every single .c file generates this error when using --debug.

Discussion

  • Brian Ruthven

    Brian Ruthven - 2013-12-29

    I've also tried using sdar as per the documentation, and that fails with the same message:

    /sw/bin/sdar -cr foo.lib foo.rel
    BFD: foo.rel:2: Unexpected character `X' in asxxxx .rel file
    
     
  • Ben Shi

    Ben Shi - 2015-07-08

    Fixed in reversion #9281.

     
  • Ben Shi

    Ben Shi - 2015-07-08
    • status: open --> closed-fixed
    • assigned_to: Ben Shi
    • Category: Z80 --> Tools
     
  • fruitCoder

    fruitCoder - 2019-12-30

    I experience the exact same problem when building a lib for the stm8 controller. When adding the --debug I get that error while creating a release build it works like a charm. Can't debug my libs.. :-( Looks like same bug @benshi?

     

Log in to post a comment.