Lewis Kelsey
Lewis Kelsey

Reputation: 4687

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

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.

Upvotes: 8

Views: 222

Answers (1)

arye
arye

Reputation: 500

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

Upvotes: 0

Related Questions