* Constructors/Destructors on hppa64-hp-hpux11
@ 2002-11-06 12:00 John David Anglin
0 siblings, 0 replies; only message in thread
From: John David Anglin @ 2002-11-06 12:00 UTC (permalink / raw)
To: gcc-patches
Constructors and destructors were not being run for the dependencies
of dynamic objects. We need to define LDD_SUFFIX and PARSE_LDD_OUTPUT,
or possibly LD_INIT_SWITCH and LD_FINI_SWITCH. Using LDD_SUFFIX and
PARSE_LDD_OUTPUT works with both the HP and GNU linkers, so that's the
approach I adopted. This patch is an interim fix until the linker
issues with using .init/.fini sections are resolved.
Tested on hppa64-hp-hpux11.11. There were no regressions. It fixes
several hundred objc FAILs.
Applied to main.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2002-11-06 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa64-hpux.h (LDD_SUFFIX, PARSE_LDD_OUTPUT): Define.
Index: config/pa/pa64-hpux.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/pa/pa64-hpux.h,v
retrieving revision 1.16
diff -u -3 -p -r1.16 pa64-hpux.h
--- config/pa/pa64-hpux.h 5 Nov 2002 16:51:10 -0000 1.16
+++ config/pa/pa64-hpux.h 6 Nov 2002 06:50:59 -0000
@@ -135,6 +135,21 @@ do { \
#undef STARTFILE_SPEC
+
+/* Since we are not yet using .init and .fini sections, we need to
+ explicitly arrange to run the global constructors and destructors.
+ HPUX 11 has ldd and we use it to determine the dependencies of
+ dynamic objects. It might be possible to use the ld options for
+ running initializers and terminators and thereby avoid the necessity
+ of running ldd, but unfortunately the options are different for
+ the two linkers. */
+#define LDD_SUFFIX "/usr/ccs/bin/ldd"
+/* Skip to first '>' then advance to '/' at the beginning of the filename. */
+#define PARSE_LDD_OUTPUT(PTR) \
+do { \
+ while (*PTR != '>') PTR++; \
+ while (*PTR != '/') PTR++; \
+} while (0)
#endif
/* Switch into a generic section. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-11-06 20:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06 12:00 Constructors/Destructors on hppa64-hp-hpux11 John David Anglin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).