473,656 Members | 2,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1462
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
1800
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 the library in Linker-General-Addition Library Directories field under the Project options. The first question I have is....is this the correct way to include a static library. If not, then what is the correct way to do it (I need to make .NET...
0
1625
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 the library in Linker-General-Addition Library Directories field under the Project options. The first question I have is....is this the correct way to include a static library. If not, then what is the correct way to do it (I need to make .NET...
12
801
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 Guide" Using Dev-C++ 4.9.9.2, The error is: undefined reference to ‘f(int)’ all the following files are in the same dir. thanks
2
1712
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 doubts will also do, just specify the link of the doc. After reading some documents online, i have perceived that the some information about symbol resolution is built into the executable.
8
1773
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
907
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 combined and which sections will be in different sections of the image ; and how the linker chooses the name of the resulting sections of the image I have seen sections with quite different names be combined into a single section of the image file -...
1
2261
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 the new IDE. The project itself links against some import libraries belonging to dll's I wrote (these dll's have been ported too, of course). To keep things simple I only use one import library here. To tell the linker it should link against
7
1341
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 some one please clarify. #include <iostream> using namespace std;
1
4219
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 Memory" error with some others. The strange thing is that when I try to add the icon manually to the imageList, it adds it without problems!! One of the icons that generates this problem is:
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8497
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8598
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7310
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.