process - Memory Addresses: Linker Vs. Loader -


i trying understand how memory allocation works @ different stages of compilation , loading of program.

1) compilers , assemblers generate code , data sections start @ address 0.

2) linker relocates these sections associating memory location each symbol definition, , modifying of references symbols point memory location.

3) loader loads program main memory, in context of process, and
hence @ step paging , memory management related operations done.

my question 2 things:

1)how addresses assigned linker related ones assigned loader. can call linker addresses virtual addresses?

2)do programs have same virtual addresses(that mapped different physical addresses?)

generally compilers generate relocatable code not start @ particular address. there cases no entirely possible. e.g.

int x ; int *y = &x ; 

these need special handling.

the linker merges program sections referenced compiler. output of linked program directs loader how place program in memory. instructions handle case above.

the loader follow instructions given linker.

1)how addresses assigned linker related ones assigned loader. can call linker addresses virtual addresses?

the linker produces relocatable code, unless compiler or assembly produced cannot relocated. linker not produce virtual addresses.

2)do programs have same virtual addresses(that mapped different physical addresses?)

in systems, each run of program produces same logical address layout. becoming more common not case security measure. each time program gets loaded, gets loaded differently.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -