#Linker script role confirmation.

1 messages ยท Page 1 of 1 (latest)

hushed owlBOT
#

@grave wren has a question:

karimmokhlis

Is my understanding correct if there is no os that the role of the linker script, whether in programming for an x86 operating system or a microcontroller, is to tell the linker where to place all the code that comes out of the compilation process? For example, if the compilation process produces 3 .o files, the linker script acts like a map for the linker, telling it to take all the code from these 3 files and place it in a specific location in RAM, starting from a certain address, for instance. The same applies to the data and .bss sections. Then, the linker converts all the function names that came out of the compilation process into real memory addresses based on where you specified the code should be placed. Is my understanding correct or not? I just need someone to confirm.

#

<@&987246964494204979> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Is my understanding correct if there is no os that the role of the linker script, whether in programming for an x86 operating system or a microcontroller, is to tell the linker where to place all the code that comes out of the compilation process? For ex

Yes, your understanding is correct. In the absence of an operating system, the linker script plays a crucial role in specifying the memory layout of the program and telling the linker where to place various sections of code and data.

Useful links: