What is a long section (fragment)? #pragma section (".rdata$T", long, read)
Asked Answered
S

1

8

What does long and short mean in the context of sections in the object file? It seems to refer to its size, but there is no documentation on it. Here we see the section name .rdata$T is long, but I don't know what that means, and whether it applies to .rdata as a whole or just the fragment .rdata$T.

Semifluid answered 20/3, 2021 at 16:42 Comment(1)
IMAGE_SCN_LNK_NRELOC_OVFL section flag, more than 65535 relocatable items. Surely undocumented today because a linker can easily figure this out by itself.Acaulescent
L
0

From the link, it seems like short section refers to the GP related data section and long is non GP related data.

In general the gp register points to section of data that is not big (and probably hence the name 'short') and load assembly calls take less code space as there is no need to give the full address, just the offset from GP. Another advantage of GP is that the memory addresses of this section cad be defined in runtime (and need to change GP value accordingaly).

See example for GP here and here

Legnica answered 10/3 at 9:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.