public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: ali hagigat <hagigatali@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: .text, .data and .bbs!!
Date: Sun, 05 Dec 2010 07:19:00 -0000	[thread overview]
Message-ID: <AANLkTikogsK2O0S3nQzAdCPs6m3BicGb3GttbnS3tMkM@mail.gmail.com> (raw)

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-----
>

             reply	other threads:[~2010-12-05  7:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-05  7:19 ali hagigat [this message]
2010-12-06  0:06 ` Nicolás Dato
  -- strict thread matches above, loose matches on Subject: below --
2010-12-04 11:16 ali hagigat
2010-12-04 21:07 ` Nicolás Dato
2010-12-05  7:20   ` ali hagigat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikogsK2O0S3nQzAdCPs6m3BicGb3GttbnS3tMkM@mail.gmail.com \
    --to=hagigatali@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).