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 8151299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:20:20+00:00 2026-06-06T15:20:20+00:00

I’m working in a C project that has a call to ld in its

  • 0

I’m working in a C project that has a call to ld in its build system like this:

ld --allow-multiple-definition --architecture mips -EB --relocatable a.o b.o c.o -o mylib.a a.o b.o c.o

But I’ve ran into a problem with the size of this command line (around 32 thousand chars with all the object files needed – and using cygwin) so I started to study a few modifications to it. One of them was to remove the second referecens to the same objects. Like this:

ld --allow-multiple-definition --architecture mips -EB --relocatable a.o b.o c.o -o mylib.a

However, this broke things down. I get lots and lots of undefined references all over the place.

Why did this happen? What is the difference between both calls? I’m reading ld’s docs but so far no good.

BONUS

If you are lucky enough, your ld version might have the –start-group objs.o –end-group option to take care of things like that.

  • 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-06-06T15:20:22+00:00Added an answer on June 6, 2026 at 3:20 pm

    In general, if a library X depends on symbols defined in library Y, then X should appear ahead of Y in the list of libraries supplied to ld. It looks like you can work around this by supplying the names of your object files twice: this way, each pair of {X, Y} will also appear in the list as {Y, X}, and will link regardless of the intra-object dependencies. Sometimes you have cyclic references; then you must put an object on the ld‘s list twice.

    Typically, you just play around with the ordering until you get it right. However, it does not look like it’s possible with your 32-K command line. I read here that lorder and tsort can assist you in determining the right order automatically, but I cannot say if it’s right or wrong, because I never used these tools.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.