Re: program crashes on startup when compiled with 'recent' gcc

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

 



Zdeněk Sojka <zsojka@xxxxxxxxx> writes:

> The problem may be in placing the symbol in wrong section group as
> -	.section	.bss._ZGVZN1A4InitEvE1i,"awG",@nobits,_ZZN1A4InitEvE1i,comdat
> +	.section	.bss._ZGVZN1A4InitEvE1i,"awG",@nobits,_ZGVZN1A4InitEvE1i,comdat
> applied (at least to) file.s fixes the problem.

In your test case as written there should not be any such section in
file.s.  file.h only includes header.h, and does not actually define
any variables at all.

The section group symbol looks right to me--the guard variable should
be associated with the variable it is guarding, it shouldn't be in its
own group.


> Failing instruction is:
>     0x0000000000400853 <_ZN1A4InitEv+63>:   mov    %rax,-0x40085a(%rip)        # 0x0
> (writing to NULL)
> which is
> 	movq	%rax, _ZZN1A4InitEvE1i(%rip)
> in .s file

If that is writing to NULL, it suggests that _ZZN1A4InitEvE1i
(A::Init()::i) was somehow never defined.  What do you see for that
symbol using readelf -s on the executable and on the input object
files?

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux