Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the appointment of the ".group" sections of Elf-file?

Tags:

elf

I opened my object elf-file with help of readelf utility: readelf -a ./my_object.o | less As a result I got a lot of interesting information. I saw a ".group" sections with "GROUP" type within sections table. Could somebody explain me, what is the appointment of the ".group" sections?

like image 647
Lucky Man Avatar asked Sep 17 '25 16:09

Lucky Man


1 Answers

It's used to group sections together, to tell the linker that if it includes one section in the group, then it must include the others as well. Groups can also carry the GRP_COMDAT flag, which tells the linker if the same group appears in two .o files then it only needs to include one of them. I think it's used to de-duplicate C++ template instantiations.

like image 118
Lawrence D'Anna Avatar answered Sep 19 '25 08:09

Lawrence D'Anna