Lucky Man
Lucky Man

Reputation: 1518

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

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?

Upvotes: 4

Views: 2363

Answers (1)

Lawrence D'Anna
Lawrence D'Anna

Reputation: 3124

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.

Upvotes: 6

Related Questions