* [Bug target/14813] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
@ 2004-04-01 20:00 ` hjl at lucon dot org
2004-04-01 20:03 ` [Bug target/14813] [3.4.0 Regression] " hjl at lucon dot org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl at lucon dot org @ 2004-04-01 20:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From hjl at lucon dot org 2004-04-01 20:00 -------
Created an attachment (id=6025)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6025&action=view)
A testcase
# make
/usr/gcc-3.4/bin/gcc -O -g -c -o bar.o bar.c
/usr/gcc-3.4/bin/gcc -static bar.o -o bar
./bar
preinit array 0
preinit array 1
preinit array 2
init array 0
init array 1
init array 2
init
fini array 2
fini array 1
fini array 0
fini
The right one should be
[hjl@gnu-4 init]$ make CC=gcc
gcc -O -g -c -o bar.o bar.c
/tmp/ccyDlcv7.s: Assembler messages:
/tmp/ccyDlcv7.s:184: Warning: ignoring incorrect section type for
.preinit_array/tmp/ccyDlcv7.s:292: Warning: ignoring incorrect section type for
.init_array
/tmp/ccyDlcv7.s:400: Warning: ignoring incorrect section type for .fini_array
gcc -static bar.o -o bar
./bar
preinit array 0
preinit array 1
preinit array 2
init
init array 0
init array 1
init array 2
fini array 2
fini array 1
fini array 0
fini
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4.0 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
2004-04-01 20:00 ` [Bug target/14813] " hjl at lucon dot org
@ 2004-04-01 20:03 ` hjl at lucon dot org
2004-04-01 20:05 ` [Bug target/14813] [3.4/3.5 " pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl at lucon dot org @ 2004-04-01 20:03 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|The wrong init order |[3.4.0 Regression] The wrong
| |init order
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
2004-04-01 20:00 ` [Bug target/14813] " hjl at lucon dot org
2004-04-01 20:03 ` [Bug target/14813] [3.4.0 Regression] " hjl at lucon dot org
@ 2004-04-01 20:05 ` pinskia at gcc dot gnu dot org
2004-04-01 21:05 ` hjl at lucon dot org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-01 20:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-01 20:05 -------
The last change to crtend.asm was over a year ago why was this not found way before the release?
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Summary|[3.4.0 Regression] The wrong|[3.4/3.5 Regression] The
|init order |wrong init order
Target Milestone|--- |3.4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
` (2 preceding siblings ...)
2004-04-01 20:05 ` [Bug target/14813] [3.4/3.5 " pinskia at gcc dot gnu dot org
@ 2004-04-01 21:05 ` hjl at lucon dot org
2004-04-06 9:42 ` jakub at gcc dot gnu dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl at lucon dot org @ 2004-04-01 21:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From hjl at lucon dot org 2004-04-01 21:05 -------
Created an attachment (id=6026)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6026&action=view)
A patch
This patch should work for both 3.4 and 3.5.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
` (3 preceding siblings ...)
2004-04-01 21:05 ` hjl at lucon dot org
@ 2004-04-06 9:42 ` jakub at gcc dot gnu dot org
2004-04-06 18:09 ` hjl at lucon dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2004-04-06 9:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jakub at gcc dot gnu dot org 2004-04-06 09:42 -------
H.J., can you please post your patches to gcc-patches and put URL into
gcc-patches archive into the PRs instead of just attaching them to PRs and
not mentioning them on gcc-patches at all?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
` (4 preceding siblings ...)
2004-04-06 9:42 ` jakub at gcc dot gnu dot org
@ 2004-04-06 18:09 ` hjl at lucon dot org
2004-04-13 0:03 ` hjl at lucon dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl at lucon dot org @ 2004-04-06 18:09 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From hjl at lucon dot org 2004-04-06 18:09 -------
The bug was introduced by
http://gcc.gnu.org/ml/gcc-cvs/2003-05/msg00274.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
` (5 preceding siblings ...)
2004-04-06 18:09 ` hjl at lucon dot org
@ 2004-04-13 0:03 ` hjl at lucon dot org
2004-04-13 18:35 ` hjl at lucon dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl at lucon dot org @ 2004-04-13 0:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From hjl at lucon dot org 2004-04-12 23:06 -------
Created an attachment (id=6080)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6080&action=view)
An updated patch
__do_jv_register_classes should be place before
__do_global_ctors_aux to preserve the init order
the same as gcc 3.3.
--
What |Removed |Added
----------------------------------------------------------------------------
Attachment #6026 is|0 |1
obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
` (6 preceding siblings ...)
2004-04-13 0:03 ` hjl at lucon dot org
@ 2004-04-13 18:35 ` hjl at lucon dot org
2004-04-13 18:36 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hjl at lucon dot org @ 2004-04-13 18:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From hjl at lucon dot org 2004-04-13 16:48 -------
A testcase is posted at
http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00788.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
` (7 preceding siblings ...)
2004-04-13 18:35 ` hjl at lucon dot org
@ 2004-04-13 18:36 ` pinskia at gcc dot gnu dot org
2004-04-21 23:19 ` wilson at specifixinc dot com
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-13 18:36 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
` (8 preceding siblings ...)
2004-04-13 18:36 ` pinskia at gcc dot gnu dot org
@ 2004-04-21 23:19 ` wilson at specifixinc dot com
2004-04-21 23:42 ` cvs-commit at gcc dot gnu dot org
2004-04-22 0:06 ` pinskia at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: wilson at specifixinc dot com @ 2004-04-21 23:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From wilson at specifixinc dot com 2004-04-21 22:37 -------
Subject: Re: [3.4/3.5 Regression] The wrong init order
pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-01 20:05 -------
> The last change to crtend.asm was over a year ago why was this not found way before the release?
This only fails if an application or library uses init_array/fini_array.
GCC still uses ctors/dtors sections instead of the preferred and
standardized init_array/fini_array sections. So the only way that you
can trigger this problem is if someone explicitly uses attribute section
init_array, or if you link with code compiled by another compiler.
I suspect the latter method is how HJ found the problem, e.g. he may
have noticed the problem after trying to link icc compiled code with
gcc compiled code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
` (9 preceding siblings ...)
2004-04-21 23:19 ` wilson at specifixinc dot com
@ 2004-04-21 23:42 ` cvs-commit at gcc dot gnu dot org
2004-04-22 0:06 ` pinskia at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-21 23:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-04-21 23:19 -------
Subject: Bug 14813
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: hjl@gcc.gnu.org 2004-04-21 23:19:09
Modified files:
gcc : ChangeLog
gcc/config/ia64: crtbegin.asm crtend.asm
Log message:
2004-04-21 H.J. Lu <hongjiu.lu@intel.com>
PR target/14813
Backport from mainline:
* config/ia64/crtend.asm: Move pointer to __do_global_ctors_aux
in .init_array section to ...
* config/ia64/crtbegin.asm: Here.
* config/ia64/crtend.asm: Mark __do_global_ctors_aux global
and hidden if HAVE_INITFINI_ARRAY is defined.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.405&r2=2.2326.2.406
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/crtbegin.asm.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.16&r2=1.16.16.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/crtend.asm.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.12&r2=1.12.16.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug target/14813] [3.4/3.5 Regression] The wrong init order
2004-04-01 19:58 [Bug target/14813] New: The wrong init order hjl at lucon dot org
` (10 preceding siblings ...)
2004-04-21 23:42 ` cvs-commit at gcc dot gnu dot org
@ 2004-04-22 0:06 ` pinskia at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-22 0:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-21 23:22 -------
Fixed for 3.4.1.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14813
^ permalink raw reply [flat|nested] 13+ messages in thread