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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:10:22+00:00 2026-06-12T06:10:22+00:00

In a project, my colleague create a static library, e.g liba.a, which linked with

  • 0

In a project, my colleague create a static library, e.g liba.a, which linked with app.

In liba.a he overwrites the libc malloc() to his owner version.

I create a shared library libs.so which also linked with app.

The problem is when my libs.so linked with app, the malloc() used in my libs.so will be the one in liba.a,
not the one in standard libc.so, this causes problems.

Then, I want static link the libc.a to my libs.so, I used -static -shared -fPIC flags for gcc.

But I always get arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld: arm-2012.03/bin/../arm-none-linux-gnueabi/libc/usr/lib/libc.a(dl-tsd.o)(.text+0x14): R_ARM_TLS_LE32 relocation not permitted in shared object.

Does anyone have idea about it?

Thanks forward.

  • 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-12T06:10:23+00:00Added an answer on June 12, 2026 at 6:10 am

    You can’t, because code that goes in shared library must be compiled with -fPIC and code in static libraries isn’t. If you managed to do it, the resulting executable would end up linked with libc multiple times, which would be really fragile anyway and probably crash sooner or later, so you shouldn’t do it anyway. Therefore:

    Don’t. Dynamic libraries have to link against system libraries dynamically and any executable that links against any dynamic libraries also has to link system libraries dynamically.

    I would also like to remind you, that linking GNU libc against non-GPL application statically is illegal, since LGPL only excepts dynamically linked code. This is on purpose to allow bugfixing the library without recompiling the executable for which source may not be available. It’s rather common in Linux to upgrade shared libraries with bugfixed version without recompiling dependent executables; libc developers know how to do that.

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

Sidebar

Related Questions

I have a college project in which I need to create a program which
In college, my senior project was to create a simple 2D game engine complete
I am taking over a project left by previous colleague. The project is mavenized
I'm working on a project after my ex-colleague. The code was great except for
I took over a Visual C++ project in Visual Studio 2005 from a colleague.
I'm supposed to write unit tests for a project whose code another colleague has
Few years ago (2005), a colleague created a VS2005 project an Web Application and
I'm doing a project for college and have create a panel with a simple
I recently took over a project that a colleague was working on and I
A colleague of mine was implementing a new feature in a project we work

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.