From x86 formats the text, data and bss section and their s-versions are said to be free formats where can I find these specifications?
rdata is not considered free format and srdata is. I think this is some error in specification. Isn't it?
Are these formats same as in COFF?
Where to find rdata specification?
And sections used by another compilers are idata edata (DLL) reloc (object file)? Where can I find these specifications?
PE/COFF format
Re: PE/COFF format
In general, the Executable and Linkable Format (ELF) is favored in this community because it's fully free, widely available, and well documented/standardized. You may wish to use/study ELF instead of PE/COFF.
If you insist, then I can see a bunch of information on Google. I see a Microsoft specification, two wikipedia pages and a link to our wiki as the first four results on my personal Google. It should be simple enough to find information on this matter, let us know if you fail to find something specific. I don't entirely understand your question, so it's likely you already found this, if I misunderstood your question please rephrase it.
Note that the contents of the program segments (text, data, bss, ...) are not standardized. This is part of the program itself and is meant simply to be loaded into memory by the program loader at certain locations and then execution transferred to the program entry point. All the meaning to these segments is given by the program itself. (Note that some segments may contain debugging information and other standardized embedded resource formats, these may well have some specification).
If you insist, then I can see a bunch of information on Google. I see a Microsoft specification, two wikipedia pages and a link to our wiki as the first four results on my personal Google. It should be simple enough to find information on this matter, let us know if you fail to find something specific. I don't entirely understand your question, so it's likely you already found this, if I misunderstood your question please rephrase it.
Note that the contents of the program segments (text, data, bss, ...) are not standardized. This is part of the program itself and is meant simply to be loaded into memory by the program loader at certain locations and then execution transferred to the program entry point. All the meaning to these segments is given by the program itself. (Note that some segments may contain debugging information and other standardized embedded resource formats, these may well have some specification).
Re: PE/COFF format
So is it data dependent on instruction set?
Re: PE/COFF format
What is? The text segment? Yes, that segment is filled with instructions for the target machine. Note however that this is not enforced, it could actually contain anything, the program loader will load it and try to execute it as program code.
Re: PE/COFF format
I have been looking in to this, because I want to write a PE conversion to Elf conversion utility. It would seem that .text, .bss, .data and .rdata (read only data) are the only ones we need worry about. The rest have to do with the internal workings of Windows; such as linkage to DLLs or debugging information.
.text is code
.bss is uninitialised data
.data is initialised data
.rdata is read only data
Microsoft hasn't get a monopoly on those names. Even if they had, I doubt if they would bother suing anybody else for using them.
The three types of data are split up in that way because uninitialised data does not need to be stored in the program file (there is nothing to store), and only one copy of read only data needs to be loaded into the computer's memory (different users running the same program would all be able to read it, but none of them could modify it).
.text is code
.bss is uninitialised data
.data is initialised data
.rdata is read only data
Microsoft hasn't get a monopoly on those names. Even if they had, I doubt if they would bother suing anybody else for using them.
The three types of data are split up in that way because uninitialised data does not need to be stored in the program file (there is nothing to store), and only one copy of read only data needs to be loaded into the computer's memory (different users running the same program would all be able to read it, but none of them could modify it).