Subject: Re: Bug in gcc and egcs with .linkonce
From: [email-masked] (Mumit Khan)

28 Aug 1998 22:39:50 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
To: [email-masked] (Ralf Scheidhauer)
Cc: [email-masked]

[email-masked] (Ralf Scheidhauer) writes:
> 
> Maybe the following is a known problem, but I could not find any
> reference to it so far.
> 

There were a few references here (I remember a few, eg., the one from 
Mark Salazar), but mostly directly to me via private email. I have about 
25 messages in my queue with various testcases that show this same bug.

> Looking at the assembler code, the reason seems to be the 
> ".linkonce discard" being used for the inline function. Unfortunately
> a ".text" gets in front of the jump table being generated for the
> switch statement. It then crashes if "bug" is not being inlined. 

You're right about the mysterious .text (which is really the output from
readonly_data_section, which for x86-win32 is .text, not .rdata yet), and
I just figure out why the C front end insists on doing this.

> Anyone know how to fix that? Otherwise I cannot debug my application
> at all! I puzzles me that no one else has had that problem before???
> 

If I knew how to fix it, it would be fixed by now ;-) I've been ignoring
this since there is a easy workaround (and easy to spot, since your
program simply crashes), but it's in the egcs-bugs list and will get
looked at eventually.

Regards,
Mumit
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".