public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: luyung@leland.Stanford.EDU (Yung-Hsiang Lu)
To: help-gcc@gnu.org
Subject: link personal library before standard library
Date: Tue, 30 Nov 1999 23:28:00 -0000	[thread overview]
Message-ID: <814e61$4n$1@nntp.Stanford.EDU> (raw)
Message-ID: <19991130232800.cd4S5xZS8d6sSUomYUNARIyWelksx3LtGO0V7E16nbI@z> (raw)

Hi,

I have a question about linking with library.

Can I link my personal library first and then the standard library?
If so, how to do this?  Thank you very much.

Imagine I have a (large) legacy program that does not check the return
code of malloc.  I would like to link it to my personal library that
implements a wrapper for malloc (such as checking return code), then
link with the real standard library.  To illustrate this idea

legal code        my library                       standard library
  .......         
  malloc    -----> malloc()
  .......         {           |----------------->  malloc
                      if (malloc() == NULL)
                      .......
                  }

Platform: SunOS 5.6 and Linux 2.2.5
-- 
                                                   Sincerely,
                                                   Yung-Hsiang Lu
                                                   luyung@stanford.edu

             reply	other threads:[~1999-11-30 23:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-19 13:11 Yung-Hsiang Lu [this message]
1999-11-30 23:28 ` Yung-Hsiang Lu

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='814e61$4n$1@nntp.Stanford.EDU' \
    --to=luyung@leland.stanford.edu \
    --cc=help-gcc@gnu.org \
    /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).