This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

.text, .data and .bbs!!


Thank you for the reply. We see .text, .data and .bss for any
C/Assembly code compiled by GNU GCC. I am using Linux, Fedora 12 and
my question was not about Windows.
I want to jump into the technical details of open source tools like
GCC. I know that I can define some new sections but , will .text exist
anyway?
Nicolas, having those sections are not related to Kernel!!, Kernel has
a loader and it will load ELF by the information of its header. What
is the role of .text in this header, is it a predefined default name?
or it can be any name we specify inside the program?
These are some questions we can deal with.
- Hide quoted text -

On 12/4/10, Nicolás Dato <nicolas.dato@gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> ali hagigat wrote:
>> I want to write a C or Assembly program and compile it by GCC. Is it
>> possible to compile(or assemble) the code so that the final object
>> code does not have any .text, .data and .bss sections?
>> Generating these sections are compulsory by GCC?
>
> I think those sections are compulsory by the kernel! but i don't know, you
> are perhaps
> looking for something "flat", without sections, without header, just the
> assembled code,
> right? like a .com windows program? (in this case i don't have the answer)
> Because an ELF (also PE) program must have sections, usually one for the
> code (you can
> execute and read, but not write), other for the variables (read and write
> access, -also
> execute-), and another section with the addresses of the imported functions.
> *I think* this is how it works nowadays.
>
> - --
> "Do you pine for the nice days of minix-1.1, when men were men and wrote
> their own device
> drivers?" -- Linus Torvalds
> "If you want to go somewhere, goto is the best way to get there." --  Ken
> Thompson
> "Value your freedom or you will lose it" -- Richard Stallman
>
> GNU/Linux Registered User #460377
> Slackware 13.0 64 bits
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkz6n/sACgkQOLozpb7LE6JgrgCfcs1RNxHaTfG/Tee1u4yuV4v2
> lrgAoJk4YVEQIQHMeYZ5lg5EsVWo4GFx
> =4mmg
> -----END PGP SIGNATURE-----
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]