cancel
Showing results for 
Search instead for 
Did you mean: 

Linker file explanation?

Mani1
Associate II

Can you explain what is the use of these section in .ld file

KEEP (*(.init)) in text section

KEEP (*(.fini)) in text section

*(.eh_frame) in text section

*(COMMON) in bss section

and whats the difference b/w

*(.rodata) and *(.rodata*) 

Thanks

D.Manikandan

2 REPLIES 2

https://sourceware.org/binutils/docs/ld/Input-Section-Keep.html

... and read the whole manual there.

.eh_frame and COMMON are just some input section names presumably used by the compiler to locate certain code/data to where it belongs.

*(.rodata*) is an input section including any section starting with .rodata and whatever after it, eg. .rodata1234 or .rodata_foo; *(.rodata) is an input section (from any file, that's what the first asterisk indicates) which is called exactly .rodata

JW

Thanks for your reply @waclawek.jan