Just curious to know what is the difference between such constructions (for text, data, rodata, bss etc) in linker script:
.data :
{
*(.data)
}
.data :
{
*(.data*)
}
.data :
{
*(.data.*)
}
In all cases we gather data sections from all object files, but the devil is in the detail.
Fast test showed that addresses in map file differ and in turn it influences the size of executable file.
I tried to find the information in ld documentation but found nothing (or just missed it).
I guess that it should be something very simple (so called obvious).
Any ideas will be highly appreciated.
In any place where you may use a specific file or section name, you may also use a wildcard pattern.
It works like a regular pattern
*(.data)
- .data sections, Example: .data
*(.data*)
- .data* section, Example: .dataTEST
*(.data.*)
- .data.* section, Example: .data.TEST
Find more info here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With