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 hpux 10.20


  In message <200105312159.RAA21612@hiauly1.hia.nrc.ca>you write:
  > I have revised the patch.  This is for the 3.0 branch.  For the main,
  > only the last two hunks are applicable.
  > 
  > > Geoff K already checked in a patch right around the first hunk - please
  > > update your sources and recheck, because part of the code you're
  > > patching no longer exists.
  > 
  > I reworked Geoff's patch for the branch.  It also resolves the section
  > problem for the address constant.  Thus, it should be preferred for
  > the sake of compatibility.
  > 
  > > > I also noted that the class reference labels were output without changi
  > ng
  > > > to the readonly data section.  On the HP, they were going into the $COD
  > E$
  > > > subspace (the text section).
  > > 
  > > The second hunk looks OK to me, although just for paranoia's sake it
  > > would be good to have a Linux build/test (any arch) for the branch.
  > 
  > I also reworked this part.  On inspection of the hppa assembler code,
  > I noticed that there was no alignment output for __objc_class_name_Object.
  > I presume for example that __objc_class_name_Object is a handle for
  > _OBJC_CLASS_NAME_0 and that the addresses should be the same.  The lack
  > of alignment alignment output for __objc_class_name_Object could cause
  > the addresses to differ.
  > 
  > The code is now modified to use a declaration for __objc_class_name_Object
  > to generate the label.  The decl for __objc_class_name_Object has the same
  > type and therefore alignment as _OBJC_CLASS_NAME_0.  The dont_output_data
  > mode of assemble_variable is used so that __objc_class_name_Object and
  > _OBJC_CLASS_NAME_0 are now at the same address.  As a side benefit,
  > debugging information for the symbol should now be correct although
  > I haven't checked this.  Setting DECL_INITIAL to error_mark_node is
  > necessary for it to go in the readonly section when possible.
  > 
  > I have built and checked this change under hppa1.1-hp-hpux10.20 and 
  > i686-pc-linux-gnu.  No testsuite errors were observed using -static,
  > -threads (-pthreads), -fPIC or "".  I have also examined the assembler
  > output from Object.m to see that it looks ok.
  > 
  > This fixes a critical usage problem under hppa1.1-hp-hpux10.20 and I
  > believe therefore that it should be installed on the branch.
  > 
  > Dave
  > -- 
  > J. David Anglin                                  dave.anglin@nrc.ca
  > National Research Council of Canada              (613) 990-0752 (FAX: 952-6
  > 605)
  > 
  > 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.

If Stan or Geoff could comment, it would be greatly appreciated (the former
because he knows more about objc the latter because he's already got some
state on the patch).

jeff


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