64bit - x64 Portable Executable section order -


can 3 essential sections: .data (resources), .rdata (imports), , .text (instructions) in portable executable (.exe) file format in order long 'address of entry point' field points .text section? seems having instructions (.text) first big pain in butt since have calculate imports , resources sections write instructions section...

this i'm going off of: https://i.imgur.com/liimg.jpg

what run-time performance?

as answered hans, linker free arrange sections in order, seen best fit. exception named sections .text$a , .text$b, sections must sorted in lexicographical order according suffix following $.

the order sections written linker not of great significance how easy produce final binary, either. typically, binary file isn't written sequentially sections computed; rather, section contents produced in buffers, , references between code , data kept symbolic (in relocatable format) until sections written final executable.

the part of question relating performance has more how image loader in windows works, rather linker. because loader not need sections in particular order, there no additional overhead (e.g. related sorting) when unpacking sections memory view of image file. relocations , matching between import , export tables done in case, , amount of work decided other factors. hence, order decided linker not in affect loading time.

for normal windows api or native binaries (not clr), section names not important either--only characteristics of each section, decide e.g. access rights of memory mapped pages in image (whether read-only, writable, executable, etc.). example, import table may placed in section named .idata rather .rdata, or section may named different.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -