This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: AIX/g++ const structs containing function addresses fail.
- To: Matthew Brown <mbrown at mediadb dot net>
- Subject: Re: AIX/g++ const structs containing function addresses fail.
- From: "Norman E. Brake, Jr." <nebrake at austin dot ibm dot com>
- Date: Tue, 30 Nov 1999 12:50:51 -0600
- CC: Jeffrey A Law <law at cygnus dot com>, gcc-bugs at gcc dot gnu dot org
- Organization: IBM AIX Development
- References: <01d001bf3b53$d5f4fc70$2301a8c0@mediadb.net>
My fix was to move an opcode constant from the c++ sub-tree
up to the
main C compiler and add it to the code gen switch to trigger
a switch
away from the text sect. As follows:
diff -c -r gcc-2.95.1/gcc/cp/cp-tree.def
gcc-2.95.1-norm/gcc/cp/cp-tree.def
*** gcc-2.95.1/gcc/cp/cp-tree.def Mon May 17 11:07:30
1999
--- gcc-2.95.1-norm/gcc/cp/cp-tree.def Tue Aug 24 13:41:18
1999
***************
*** 29,39 ****
just won't work for us. */
DEFTREECODE (OFFSET_REF, "offset_ref", 'r', 2)
- /* A pointer-to-member constant. For a pointer-to-member
constant
- `X::Y' The PTRMEM_CST_CLASS is the RECORD_TYPE for `X'
and the
- PTRMEM_CST_MEMBER is the _DECL for `Y'. */
- DEFTREECODE (PTRMEM_CST, "ptrmem_cst", 'c', 1)
-
/* For NEW_EXPR, operand 0 is the placement list.
Operand 1 is the new-declarator.
Operand 2 is the initializer. */
--- 29,34 ----
diff -c -r gcc-2.95.1/gcc/tree.def
gcc-2.95.1-norm/gcc/tree.def
*** gcc-2.95.1/gcc/tree.def Mon May 17 02:21:12 1999
--- gcc-2.95.1-norm/gcc/tree.def Tue Aug 24 13:41:14
1999
***************
*** 790,795 ****
--- 790,800 ----
Operand 1 contains the case values. The way they're
organized is
front-end implementation defined. */
DEFTREECODE (SWITCH_EXPR, "switch_expr", 'e', 2)
+
+ /* A pointer-to-member constant. For a pointer-to-member
constant
+ `X::Y' The PTRMEM_CST_CLASS is the RECORD_TYPE for `X'
and the
+ PTRMEM_CST_MEMBER is the _DECL for `Y'. */
+ DEFTREECODE (PTRMEM_CST, "ptrmem_cst", 'c', 1)
/*
Local variables:
mode:c
Only in gcc-2.95.1-norm/gcc: tree.def~
diff -c -r gcc-2.95.1/gcc/varasm.c
gcc-2.95.1-norm/gcc/varasm.c
*** gcc-2.95.1/gcc/varasm.c Wed Jun 9 07:13:49 1999
--- gcc-2.95.1-norm/gcc/varasm.c Tue Aug 24 13:42:25
1999
***************
*** 3871,3876 ****
--- 3871,3880 ----
}
break;
+ case PTRMEM_CST:
+ reloc = 1;
+ break;
+
default:
break;
}
> Matthew Brown wrote:
>
> Has there been any resolution to this one? I think that I
> may be observing a similar problem if not the same one:
>
> I am attempting to build libstdc++ version 2.90.6 on AIX
> 4.2.1 for PPC RS/6000. When linking the shared object
> version of the library, the linker returns the error --
> ld: 0711-302 ERROR: Object localename.o, csect
> <_localename.rw_cc>
> The csect is part of the .text section, and
> relocation entries
> from the csect have been written to the .loader
> section.
>
> The static library links fine and when I dump headers from
> localename.o, there is no .loader section listed.
>
> I have received the same behavior with GCC versions 2.95.1
> and 2.95.2.
>
> Thanks for any help or pointers.
>
> -- Matthew Brown