This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Fix invalid loader fixups from shared libobjc with hpux10.20


> 
> law@redhat.com wrote:
> > 
> >   > 2001-05-31  John David Anglin  <dave@hiauly1.hia.nrc.ca>
> >   >
> >   >     * objc/objc-act.c (handle_class_ref): Use rest_of_decl_compilation
> >   >     so that CHOOSE_SECTION gets used.
> >   >     (handle_impent): Use assemble_variable to put the global objc class
> >   >     and category name labels in the readonly data section.
> > It's certainly wrong for a front-end to blindly dump something into the
> > readonly_data_section.  At the least it should be deferring to the routines
> > in varasm.c to select the proper section.

Regarding Jeff's comment, assemble_variable doesn't blindly dump into
the readonly_data_section section.  It calls variable_section which
selects the correct section.  It uses DECL_READONLY_SECTION to check
whether the decl is appropriate for the readonly_data_section when
SELECT_SECTION isn't defined.  The PA uses DECL_READONLY_SECTION.

In this particular case, we have a char_type_node with
DECL_INITIAL (decl) = error_mark_node.  On the PA, this in fact always
gets put into the readonly_data_section.  The same happens in C++.
The ChangeLog entry doesn't fully reflect what happens and possibly
it should be changed.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]