On 10/20/10 09:42, "C. Bergström" wrote:
Hi

Does anyone have time to take a look at this test case..

# Example
g++ -m64 -o test test.s
~$ ./test
terminate called after throwing an instance of 'int'
Abort


There's some problem with the unwind tables, but I can't spot it.. Something is 
different between sol and linux that's causing this..

Thanks

./C


Original code
------------------------------
cat test.cpp

int main() {
try {
throw (int)10;
}
catch(int i) {
return i;
}
return 0;
}



_______________________________________________
tools-compilers mailing list
[email protected]


I presume that you're hitting this:

    % g++ -m64 -o test test.s
    ld: fatal: file /var/tmp//ccsAaORD.o: section [8].eh_frame: section type is 
SHT_PROGBITS: expected SHT_AMD64_UNWIND
    collect2: ld returned 1 exit status

That error is the result of the fix I did for

    6931044 ld should not allow SHT_PROGBITS .eh_frame sections on amd64

in snv_137. I can get your code to compile by changing line 171 from

        .section .eh_frame, "a",@progbits

to

        .section .eh_frame, "a",@unwind

giving

    % g++ -m64 -o test test.s
    % ./test
    %

g++ on solaris does not use progbits for that, so I'm puzzled as to how
this piece of assembler was created. Was it created under Linux, where
they seem to accept PROGBITS as a valid section type for unwind sections
on amd64?

I'm beginning to think the fix for 6931044 needs to be changed from rejecting
progbits unwind sections, to quietly accepting them and treating them as
amd64_unwind. Anything you can tell me about how this code came into
being would be helpful. Thanks...

- Ali


_______________________________________________
tools-compilers mailing list
[email protected]

Reply via email to