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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:48:39+00:00 2026-05-17T06:48:39+00:00

My embedded projects have a post-process step that replaces a value in the executable

  • 0

My embedded projects have a post-process step that replaces a value in the executable with the CRC of (some sections of) the flash. This step can only be done after linking since that is the first opportunity to CRC the image. In the past the file format was COFF, and I have created a custom tool to do the patching.

The development tool has switched to ELF, so I need to re-implement the CRC patcher. Before I do, I thought I’d look for an existing tool to do this. The compiler is based on gcc, but I can’t see any combination of ld and nm and readelf that can do the job. A Google search has not been fruitful.

My present tool uses nm to find the address to patch, and calls the patcher with the address, the expected value (to prevent overwriting the wrong data), and the new CRC value. The CRC is calculated on a “hex” format of the executable (that I also patch) so fortunately I don’t have to redo that part.

I can implement this with libelf and custom code again, but before I do, does it already exist?

Is there a better way to accomplish my goal of putting a CRC of the executable into the executable so it’s available to the application?

  • 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-17T06:48:40+00:00Added an answer on May 17, 2026 at 6:48 am

    If I’ve understood what you’re trying to do correctly, I think the following would work:

    • nm gives you the runtime virtual address of the location you want to patch;
    • readelf -S gives you both the runtime virtual address and the offset within the file for the beginning of each section;
    • stitching the two together (e.g. with a few lines of your favourite scripting language) gives the offset within the file to patch.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some projects built with different versions of VS2005 that require different run-time
Background of project -> I have to upgrade the Linux embedded system remotely. This
This might be a bit tricky setup but... I have this Silverlight project that
We currently have a set of crystal reports used for winforms projects embedded into
I have a website (MVC) and some other projects in the same solution. In
I have configured my pom file to use maven-embedded-glassfish-plugin. In fact this is the
I have written a basic Windows Form app in C# that has an embedded
I have a jar embedded in a bundle that needs to fetch a resource
I have successfully embedded Chromium into my Delphi 6 projects with the help of
I have worked on projects for embedded systems in the past where we have

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.