473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Doubt about how a linker generates a memory image

Hi everyone,

I am confused about how the linker actually goes about generating a
memory image. Right now im studying how ld works, i have to use it with
an ARM920T.

Suppose i have a program with two sections, one of which has a size of
1kb, and is to be placed at location 0x200000, and another which also
has a size of 1kb and is to be placed at 0x600000. How does the linke
ensure that these sections go to the correct place? Does it do this by
padding the intermediate spaces? But if this were true, then for a 2kb
program, the size of the image would be 0x600000 + 1Kb!

When the image is loaded into the uC`s memory through, say, a serial
connection, the loading program would be dumb and would not know where
to place which part of the image..so how does the data get to the
correct place??

Plz help..

Regards

Mayank

Nov 14 '05 #1
3 1456
Mayank Kaushik wrote:
I am confused about how the linker actually goes about generating a
memory image. Right now im studying how ld works, i have to use it with an ARM920T.


This newsgroup is intended for questions on the C language. A perfectly
legal C application could be running as a script in a C scripting
engine without ever having seen a linker....

I would recommend comp.compilers

Sorry,
Chris

Nov 14 '05 #2

Chris Williams wrote:
A perfectly
legal C application could be running as a script in a C scripting
engine without ever having seen a linker....


I didnt know "C scripting engines" existed! Thanx anyway

Nov 14 '05 #3
This question is not intended here. Still I will try to give the
answer.
ld does this through elf format. Elf format has different sections.
Each section has its own phisical address. This information is passed
through elf file (your executable). Thus you need not worry about
padding of intermediate space.
For more information on ELF please refer
http://www.cs.ucdavis.edu/~haungs/paper/node10.html

Nov 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: TGF | last post by:
Hello, I am creating a console app. I try to link a static library by including it in the Linker-Input-Additional Dependencies field under the Project properties. Then I specify the path to...
0
by: TGF | last post by:
Hello, I am creating a console app. I try to link a static library by including it in the Linker-Input-Additional Dependencies field under the Project properties. Then I specify the path to...
12
by: Baloff | last post by:
Hello I have this linker error which makes me think that the definition file is not being seen by the linker, this code is taken from "Thinking in C++, 2nd Edition, Volume 1, Annotated Solutions...
2
by: Pradeep | last post by:
Hi all, I m basically trying to understand the linking/loading process, please bear with me as i have specified my question in an unclear fashion. Any document that u think can clarify my...
8
by: junky_fellow | last post by:
what would be the output for the following piece of code ? if ( "hello" == "hello" ) printf("True\n"); else printf("False\n"); What is the reason for that ?
1
by: Ben | last post by:
Hi When the linker creates an image, it combines sets of sections from the object files to single sections of the image file. I would like to know how the linker chooses which sections will be...
1
by: Felix | last post by:
After porting a project from VC6 to VC.NET 2003 I have a very strange problem generating link error 1104 for import libraries. I just ported the project and made some small adaptions so it fits...
7
by: fintracker | last post by:
hi, i just started learning c++, and i tried this sample program. i expected output to be 20 and 20 but i got 10 and 20. 'i' has not changed, but the address of i and value of ptr are same. can...
1
by: Dana | last post by:
I tried loading an icon to an imageList using the following method: Image cc = Bitmap.FromFile("C:\\myicon.ico"); imageList1.Images.Add(cc); It works with some icons but generates an "Out of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.