Message-ID: <34CA3F71.CD6AD0B1@gmx.net> Date: Sat, 24 Jan 1998 20:22:25 +0100 From: Robert Hoehne Organization: none provided MIME-Version: 1.0 To: andrewc AT rosemail DOT rose DOT hp DOT com, djgpp-workers AT delorie DOT com Subject: Re: -g problem References: <199801240047 DOT AA252462849 AT typhoon DOT rose DOT hp DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Because Andrew posted this also to the workers, I do cc it too to the workers, just for information. Andrew Crabtree wrote : > > Perhaps I worded it wrong, but I think this is still in the gcc sources. > I do use the egcs sources now, but I have had this problem for almost > 10 months, before egcs existed. Just copy the 6 lines of code below > to a file, and try compiling with -g, -gstabs, and no -g. This > code should be in the file libgcc1-test.c at the very bottom, but the > problem will manifest itself if you just make a foo.c with these lines ... > > extern void start() __asm__("start"); > extern void _start() __asm__("_start"); > extern void __start() __asm__("__start"); > > void start() {} > void _start() {} > void __start() {} > > I have tried to debug it and sent message to dj-workers but it is > beyond my knowledge. For some reason the assembler errors out with > -g, even though no additional symbols are defined, just debug stuff. I checked it now (got also the mail from the workers list) and found the following: This problem is to 99.99% a problem of the gcc you are using. I came to this after checking your posted assembler output. Comparing it with my generated output (from gcc 2.7.2.1 and gcc 2.8.0) there is (beside other diffs) one important diff. You have for instance between the two functions start and _start .def .ef; .val .; .scl 101; .line 1; .endef .def _start; .val .; .scl -1; .endef .def __start; .val _start; .scl 2; .type 041; .endef but I have there .def .ef; .val .; .scl 101; .line 1; .endef .def _start; .val .; .scl -1; .endef .p2align 2 .def __start; .val _start; .scl 2; .type 041; .endef (with gcc 2.7.2.1 there is a .align 2 instead of .p2align). That means now, you have modified gcc in a way, that it produces wrong (at least for gas wrong) code. You can simply check it, by inserting the align directives and it will compile OK. BTW: I don't know, why gas complains this, but it _IS_ so and I haven't the time to debug this problem since it does not happen with a normal gcc :-) Robert -- ****************************************************** * email: Robert Hoehne * * Post: Am Berg 3, D-09573 Dittmannsdorf, Germany * * WWW: http://www.tu-chemnitz.de/~sho/rho * ******************************************************