public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Klein <mklein@dis.com>
To: law@cygnus.com
Cc: gcc@gcc.gnu.org
Subject: Re: MPE Port and collect
Date: Wed, 10 Nov 1999 07:48:00 -0000	[thread overview]
Message-ID: <4.2.0.58.19991110072954.00a1a5f0@garfield.dis.com> (raw)
In-Reply-To: <2799.942119599@upchuck>

At 08:53 PM 11/8/99 -0700, Jeffrey A Law wrote:

>So instead collect builds and exports a single constructor function for the
>entire library.  *that* function should be added to he ctor/dtor list for
>the main program.

That appears not to be happening and I don't see anything in the source code
that looks as it would do what you describe.

Here's the pertinent output of collect with debugging enabled:

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n a.out

nm output with constructors/destructors.
         00026fa4 T _GLOBAL_$I$tie__C3ios
         00026fc0 T _GLOBAL_$I$tie__C3ios
         00026ff4 T _GLOBAL_$D$tie__C3ios
         00027010 T _GLOBAL_$D$tie__C3ios

  /DIS/GNU/src/egcs-ss/obj-MPE/gcc/ldd a.out

ldd output with constructors/destructors.
         a.out
           /tmp/blah1.sl
           /SYS/HPDCE/DCEXL
           /SYS/THREADS/OTHDXL

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n a.out

nm output with constructors/destructors.
         00026fa4 T _GLOBAL_$I$tie__C3ios
         00026fc0 T _GLOBAL_$I$tie__C3ios
         00026ff4 T _GLOBAL_$D$tie__C3ios
         00027010 T _GLOBAL_$D$tie__C3ios

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n /tmp/blah1.sl

nm output with constructors/destructors.
         0012b1bc T _GLOBAL_$I$__3foo
         0012b1d8 T _GLOBAL_$I$__3foo

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n /SYS/HPDCE/DCEXL

nm output with constructors/destructors.

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n /SYS/THREADS/OTHDXL

nm output with constructors/destructors.

1 constructor(s) found
1 destructor(s)  found
0 frame table(s) found
[Leaving a.out]

Note that it sees the constructor for foo in the shared library
blah1.sl. But, I don't see any function constructed below that
references the shared library blah1.sl:

========== output_file = a.out, c_file = /usr/tmp/cc9sFExG.c
#ifdef __cplusplus
extern "C" {
#endif
typedef void entry_pt();

extern entry_pt x7 __asm__ ("_GLOBAL_$I$tie__C3ios");

entry_pt * __CTOR_LIST__[] = {
         (entry_pt *) 1,
         x7,
         0
};

extern entry_pt x8 __asm__ ("_GLOBAL_$D$tie__C3ios");

entry_pt * __DTOR_LIST__[] = {
         (entry_pt *) 1,
         x8,
         0
};

extern entry_pt __main;
entry_pt *__main_reference = __main;

#ifdef __cplusplus
}
#endif
========== end of c_file

I also don't see in the source code how that is supposed to work when
the symbols from that library never get added to a list for later
processing.

I also see that collect does have quite a bit of machine specific
code. Since MPE is late binding, simply conditionalizing:

         if (which_pass != PASS_LIB)

in scan_prog_file() I believe will solve my issue. But, is there a
better way to do this?

TIA,


M.
--
Mark Klein                                 DIS International, Ltd.
http://www.dis.com                         415-892-8400
PGP Public Key Available			

WARNING: multiple messages have this Message-ID
From: Mark Klein <mklein@dis.com>
To: law@cygnus.com
Cc: gcc@gcc.gnu.org
Subject: Re: MPE Port and collect
Date: Tue, 30 Nov 1999 23:37:00 -0000	[thread overview]
Message-ID: <4.2.0.58.19991110072954.00a1a5f0@garfield.dis.com> (raw)
Message-ID: <19991130233700.D9e_zCpyA58R5RkIQvAhiTYSU3cgkDS5DCfMnhnmgOI@z> (raw)
In-Reply-To: <2799.942119599@upchuck>

At 08:53 PM 11/8/99 -0700, Jeffrey A Law wrote:

>So instead collect builds and exports a single constructor function for the
>entire library.  *that* function should be added to he ctor/dtor list for
>the main program.

That appears not to be happening and I don't see anything in the source code
that looks as it would do what you describe.

Here's the pertinent output of collect with debugging enabled:

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n a.out

nm output with constructors/destructors.
         00026fa4 T _GLOBAL_$I$tie__C3ios
         00026fc0 T _GLOBAL_$I$tie__C3ios
         00026ff4 T _GLOBAL_$D$tie__C3ios
         00027010 T _GLOBAL_$D$tie__C3ios

  /DIS/GNU/src/egcs-ss/obj-MPE/gcc/ldd a.out

ldd output with constructors/destructors.
         a.out
           /tmp/blah1.sl
           /SYS/HPDCE/DCEXL
           /SYS/THREADS/OTHDXL

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n a.out

nm output with constructors/destructors.
         00026fa4 T _GLOBAL_$I$tie__C3ios
         00026fc0 T _GLOBAL_$I$tie__C3ios
         00026ff4 T _GLOBAL_$D$tie__C3ios
         00027010 T _GLOBAL_$D$tie__C3ios

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n /tmp/blah1.sl

nm output with constructors/destructors.
         0012b1bc T _GLOBAL_$I$__3foo
         0012b1d8 T _GLOBAL_$I$__3foo

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n /SYS/HPDCE/DCEXL

nm output with constructors/destructors.

  /usr/local/hppa1.0-hp-mpeix/bin/nm -n /SYS/THREADS/OTHDXL

nm output with constructors/destructors.

1 constructor(s) found
1 destructor(s)  found
0 frame table(s) found
[Leaving a.out]

Note that it sees the constructor for foo in the shared library
blah1.sl. But, I don't see any function constructed below that
references the shared library blah1.sl:

========== output_file = a.out, c_file = /usr/tmp/cc9sFExG.c
#ifdef __cplusplus
extern "C" {
#endif
typedef void entry_pt();

extern entry_pt x7 __asm__ ("_GLOBAL_$I$tie__C3ios");

entry_pt * __CTOR_LIST__[] = {
         (entry_pt *) 1,
         x7,
         0
};

extern entry_pt x8 __asm__ ("_GLOBAL_$D$tie__C3ios");

entry_pt * __DTOR_LIST__[] = {
         (entry_pt *) 1,
         x8,
         0
};

extern entry_pt __main;
entry_pt *__main_reference = __main;

#ifdef __cplusplus
}
#endif
========== end of c_file

I also don't see in the source code how that is supposed to work when
the symbols from that library never get added to a list for later
processing.

I also see that collect does have quite a bit of machine specific
code. Since MPE is late binding, simply conditionalizing:

         if (which_pass != PASS_LIB)

in scan_prog_file() I believe will solve my issue. But, is there a
better way to do this?

TIA,


M.
--
Mark Klein                                 DIS International, Ltd.
http://www.dis.com                         415-892-8400
PGP Public Key Available			

  parent reply	other threads:[~1999-11-10  7:48 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-06 10:40 MPE Port Mark Klein
1999-09-07  2:38 ` Jeffrey A Law
1999-09-07  6:39   ` Mark Klein
1999-09-08  0:45     ` Jeffrey A Law
1999-09-08 20:04       ` Mark Klein
1999-09-15  2:47         ` Jeffrey A Law
1999-09-15  8:32           ` Mark Klein
1999-09-30 18:02             ` Mark Klein
1999-09-30 18:02           ` Jeffrey A Law
1999-10-09 20:18           ` Mark Klein
1999-10-14  4:03             ` Jeffrey A Law
1999-10-14  7:20               ` Mark Klein
1999-10-14 10:45                 ` Jeffrey A Law
1999-10-14 11:05                   ` Mark Klein
1999-10-31 23:35                     ` Mark Klein
1999-10-31 23:35                   ` Jeffrey A Law
1999-10-31 23:35                 ` Mark Klein
1999-10-31 23:35               ` Jeffrey A Law
1999-10-31 23:35             ` Mark Klein
1999-11-08 19:34           ` Mark Klein
1999-11-08 19:54             ` Jeffrey A Law
1999-11-09  6:52               ` Mark Klein
1999-11-30 23:37                 ` Mark Klein
1999-11-10  7:48               ` Mark Klein [this message]
1999-11-30 23:37                 ` MPE Port and collect Mark Klein
1999-11-30 23:37               ` MPE Port Jeffrey A Law
1999-11-30 23:37             ` Mark Klein
1999-09-30 18:02         ` Mark Klein
1999-09-30 18:02       ` Jeffrey A Law
1999-09-30 18:02     ` Mark Klein
1999-09-30 18:02   ` Jeffrey A Law
1999-09-30 18:02 ` Mark Klein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.2.0.58.19991110072954.00a1a5f0@garfield.dis.com \
    --to=mklein@dis.com \
    --cc=gcc@gcc.gnu.org \
    --cc=law@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).