[M3devel] the SOLgnu alignment problem finally understood

Olaf Wagner wagner at elegosoft.com
Mon Aug 3 13:26:28 CEST 2009


We had similar problems before with -g. CM3 never supported dwarf
debugging format, just stabs. I think we changed all -g occurences
in the config files to -gstabs some years ago.

It sounds like a small fix in the config files after all, correct?
At least for this RC?

Olaf

Quoting Jay K <jay.krell at cornell.edu>:

>
> Here finally is a small example of the SOLgnu problem I've been   
> looking at it.
>
>
> It is specific to using /usr/sfw/bin/gcc -g to asssemble.
> No problem without -g, no problem with /usr/bin/cc, no problem with
> whatever I built in /usr/local/bin/gcc, no problem if you assemble
> with anything else and then link with /usr/sfw/bin/gcc -g.
>
>
> -bash-3.00$ cat 4.c asm.s
>
> 4.c
> void Asm(void);
> #include
>
> int main()
> {
>   Asm();
>   printf("\n");
>   return 0;
> }
>
> asm.s
>
>   .section ".text",#alloc,#execinstr
>   .align 4
>   .global Asm
>   .type Asm,#function
> Asm:
>   retl
>   nop
>   .size Asm, (.-Asm)
>
>
> Not all possibilities shown here:
>
>
> -bash-3.00$ /usr/local/bin/gcc -g asm.s 4.c
>  ok
>
>
> -bash-3.00$ /usr/sfw/bin/gcc -g asm.s 4.c
> ld: fatal: relocation error: R_SPARC_32: file /var/tmp//ccICgvny.o:   
> symbol : offset 0xfeed139e is non-aligned
> ld: fatal: relocation error: R_SPARC_32: file /var/tmp//ccICgvny.o:   
> symbol : offset 0xfeed14c2 is non-aligned
> ld: fatal: relocation error: R_SPARC_32: file /var/tmp//ccICgvny.o:   
> symbol : offset 0xfeed15f6 is non-aligned
> collect2: ld returned 1 exit status
>
>
> -bash-3.00$ /usr/bin/cc -g asm.s 4.c
> asm.s:
> 4.c:
>  ok
>
> -bash-3.00$ /usr/bin/cc  asm.s 4.c
> asm.s:
> 4.c:
>  ok
>
>
> -bash-3.00$ /usr/sfw/bin/gcc  asm.s 4.c
>  ok
>
>
> -bash-3.00$ /usr/local/bin/gcc asm.s 4.c
>  ok
>
>
> -bash-3.00$ /usr/sfw/bin/gcc -g -c asm.s
>  ok but haven't linked yet, input to later steps
>
>
> -bash-3.00$ /usr/bin/cc  asm.o 4.c
> ld: fatal: relocation error: R_SPARC_32: file asm.o: symbol : offset 0x
> ff10148e is non-aligned
> ld: fatal: relocation error: R_SPARC_32: file asm.o: symbol : offset 0x
> ff1014ca is non-aligned
> ld: fatal: relocation error: R_SPARC_32: file asm.o: symbol : offset 0x
> ff1015be is non-aligned
>
>
> -bash-3.00$ /usr/local/bin/gcc asm.o 4.c
> ld: fatal: relocation error: R_SPARC_32: file asm.o: symbol : offset 0x
> feee1213 is non-aligned
> ld: fatal: relocation error: R_SPARC_32: file asm.o: symbol : offset 0x
> feee122a is non-aligned
> ld: fatal: relocation error: R_SPARC_32: file asm.o: symbol : offset 0x
> feee122e is non-aligned
> ld: fatal: relocation error: R_SPARC_32: file asm.o: symbol : offset 0x
> feee1232 is non-aligned
> ld: fatal: relocation error: R_SPARC_32: file asm.o: symbol : offset 0x
> feee126e is non-aligned
> collect2: ld returned 1 exit status
>
>
>
> -bash-3.00$ /usr/local/bin/gcc -g -c asm.s
>   ok, try linking with others
>
>
> -bash-3.00$ /usr/bin/cc  asm.o 4.c
>   ok
>
>
>
> -bash-3.00$ /usr/sfw/bin/gcc  asm.o 4.c
>   ok
>
>
> Actually even -gstabs or -gstabs+ instead of -g make it work.
> -g resolves to -gdwarf2.
>
>
>  - Jay



-- 
Olaf Wagner -- elego Software Solutions GmbH
                Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
    http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list