0
votes

I have read the linker script. i have got one confusion regarding allocating memory. when we define section with starting where we want to load the file.

1) does the memory locations what we have specified are applicable to virtual memory like ( . = 0x10000 ).

1
Which OS and which linker? GNU LD on Linux, maybe? Please clarify by editing text and adding tags! Also the actual script, or relevant snippet at least, would be great.hyde
thanks for asking this! this was exactly what confused me tookwagjj

1 Answers

0
votes

in your linker script (and the resulting binary), addresses are just addresses.

Whether these are meant virtual or physical solely depends on your loader (which might be a tiny bootloader at early system init that doesn't know about virtual addresses or a full blown OS that provides a sophisticated virtual environment).

So it's the program that brings your binary into memory that decides whether addresses are interpreted virtually or physically, not the linker script.

Unless you tell us about your specific environment, we can't tell you more.