Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 540435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:14:23+00:00 2026-05-13T10:14:23+00:00

I’m trying to write some small tests for a fairly small part of a

  • 0

I’m trying to write some small tests for a fairly small part of a fairly large project. Attempting to link this beast is unfortunately fairly impossible without linking the entire project together, which I don’t want to do (it’s a pretty complex system for finding all the dependencies and stuff, and I perfer not to meddle with it).

Now, I know for certain that the functions that the referenced functions won’t be called during my test, the just happen to be part of functions which share file with stuff that I do test.

Is there any way to simply link these unresolved references to, let’s say, abort, or something? Or is there a tool which creates the appropriate stub object file where all calls result in abort, given the set of object files that I have?

I use gcc (g++) for compiling/linking, version 3.4.4. Platform is unix (solaris/sparc if that’s important).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:14:24+00:00Added an answer on May 13, 2026 at 10:14 am

    You can just tell linker to ignore unresolved symbols. I couldn’t find option that links them to abort or something like that.

    The policy to ignore unresolved symbols in object files only is the most natural, I suppose:

    gcc -Wl,--unresolved-symbols=ignore-in-object-files  obj.o another.o etc.o
    

    Other options include (quoting man ld):

       --unresolved-symbols=method
           Determine how to handle unresolved symbols.  There are four possi-
           ble values for method:
    
           ignore-all
               Do not report any unresolved symbols.
    
           report-all
               Report all unresolved symbols.  This is the default.
    
           ignore-in-object-files
               Report  unresolved  symbols  that  are  contained  in   shared
               libraries,  but  ignore  them if they come from regular object
               files.
    
           ignore-in-shared-libs
               Report unresolved symbols that come from regular object files,
               but  ignore them if they come from shared libraries.  This can
               be useful when creating a dynamic binary and it is known  that
               all  the  shared  libraries  that it should be referencing are
               included on the linker's command line.
    
           The behaviour for shared libraries on their own can also  be  con-
           trolled by the --[no-]allow-shlib-undefined option.
    
           Normally  the  linker  will  generate  an  error  message for each
           reported unresolved symbol but the  option  --warn-unresolved-sym-
           bols can change this to a warning.
    

    On my Linux system attempts to call the unresolved function result in “Segmentation fault”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.