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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:22:00+00:00 2026-05-30T21:22:00+00:00

Symbols can be linked at certain addresses with defsym as illustrated here . My

  • 0

Symbols can be linked at certain addresses with defsym as illustrated here. My question is whether the same can be done with sections? That is, given some .o object file, is it possible to specify the base address that sections will be relocated to?

Alternatively, is it possible to rebase a section after the final link? That is, to change the address of a section in a binary and have all information affected by relocation (such as relative branches out of the section, etc.) to be relocated properly.

If my question is not clear, I can edit it and add an image to explain better.

  • 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-30T21:22:01+00:00Added an answer on May 30, 2026 at 9:22 pm

    Judging by the question you reference and the tag of Linux, I am going to assume that you are using GNU ld.

    The short answer for GNU ld is yes, sections can be placed at specific addresses.

    The longer answer is that you will need to create a custom linker script to do that, which can be specified the -T for ld. If you are using gcc as a wrapper around ld, you will need pass it the linker via the gcc -Wl, option.

    The linker script will have to include something like the following:

    SECTIONS {
       .text 0x08049000 :
           {
           foo.o (.text)
           bar.o (.text)
           }
    }
    

    Something to watch out for though is that -T option replaces the default linker script that ld uses. You may want to modify the default linker script to do what you want. The default linker script can be dumped by passing the --verbose option to ld without any other options.

    More info about linker scripts is available in the LD Manual.

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

Sidebar

Related Questions

I find it surprising that Ruby symbols can be typecasted to integers without errors.
Symbols such as: ♫ http://www.chatsmileysemoticons.com/music-symbol-twitter/ So that I can do something like: $tweet =
I want to create a navigation application but can't found any icons/symbols that suitable
I know that source code can be compiled and linked to shared/static library or
In MatLab, you can declare symbols pretty easily: syms a,b mat = [a,b] I'm
how can i get some part of string (in symbols). For example: $string =
How can I use displayObjects as animation frames? I have six symbols in my
How can you display a long string, website address, word or set of symbols
How can I put a question mark above a less-than-or-equal-to symbol( \leq ) in
I have problems using a shared library that was linked against a shared library.

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.