ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a doubt regarding the way a memory image is build by the linker (ld, in my case) with the output files. I dont have a Comp.Sc background, so i havent studied these things formally.
Suppose i have 2 kb of code i want to load into memory (0x0 to 0x800000 ). The output has two sections of 1kb each, one of which has to be put on location 0x200000 and the other on location 0x600000. Howdoes the linker ensure that the correct data is put at the correct location? I mean, does it generate a huge image of size 0x600000 + 1kb that has data at the correct locations, and the intermediate spaces padded?? what sends the data finally to the correct location?
Where do you get the idea that the sections have to be loaded at different memory addresses? The only thing that I'm aware of that's consistent is the starting address of every program in virtual memory.
Lets forget about virtual memory for a while..im talking about microcontrollers running without an OS..im working on the Atmel At91rm9200, that has a little RAM and no Flash. I may have the code (.text) section at one memory location and a data section at another location.
--section-start sectionname=org
Locate a section in the output file at the absolute
address given by org. You may use this option as many
times as necessary to locate multiple sections in the
command line. org must be a single hexadecimal inte-
ger; for compatibility with other linkers, you may
omit the leading 0x usually associated with hexadeci-
mal values. Note: there should be no white space
between sectionname, the equals sign (``=''), and org.
okay, now u and i are on the same wavelength..
My doubt was..How is the option uve mentioned above IMPLEMENTED by the linker? How does it make sure that the data will actually be at these locations once its loaded into the uC? What is there in the space between these sections??
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.