By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 1,000 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

Need some information in output of objdump

P: n/a
Hi All,

When objdump command is executed It has displayed so many
sections(segments) in the output
..data , .bss , .sbss , .rodata, .romdata, .COMMON, .appreset

I came to know that the following segments usage

..data - Intialised Global Data
..bss - UnIntialised Global Data
..rodata - read only data

But I want to know what .romdata,.COMMON,.appreset sections will
contain
and what is the usage of It

Thanks in advance

Regards,
Sundeep

Nov 6 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
"sunny" <su********@gmail.comwrites:
When objdump command is executed It has displayed so many
sections(segments) in the output
.data , .bss , .sbss , .rodata, .romdata, .COMMON, .appreset
[snip]
But I want to know what .romdata,.COMMON,.appreset sections will
contain and what is the usage of It
The C language says nothing about these things. You'll need to ask in
a system-specific newsgroup, perhaps comp.unix.programmer.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 6 '06 #2

P: n/a
In article <11**********************@m73g2000cwd.googlegroups .com>,
sunny <su********@gmail.comwrote:
>When objdump command is executed It has displayed so many
sections(segments) in the output
>But I want to know what .romdata,.COMMON,.appreset sections will
contain
and what is the usage of It
We don't know. objdump is not related to the C standard: it is
an artifact of your implementation. Segments aren't part of C either,
only of the implementation. The exact set of section supported
on systems that -have- sections, varies with the object format,
which varies with the system and the software version.

In other words, go ask in a newsgroup that is *very* specific for
your tools -and- the system you are interested in.
(By the way, searching for "ldscript" might give you some interesting
reading. Or perhaps not, since I cannot find any reference to
..appreset anywhere and have to wonder whether you mistyped that one.)
--
Okay, buzzwords only. Two syllables, tops. -- Laurie Anderson
Nov 6 '06 #3

P: n/a
In article <11**********************@m73g2000cwd.googlegroups .com>
sunny <su********@gmail.comwrote:
>When objdump command is executed It has displayed so many
sections(segments) in the output
.data , .bss , .sbss , .rodata, .romdata, .COMMON, .appreset

I came to know that the following segments usage

.data - Intialised Global Data
.bss - UnIntialised Global Data
.rodata - read only data
"Global" is an inappropriate adjective. These two section names
can be said to contain "initialized data" and "uninitialized data",
but said data is neither specifically "global" nor "local" (nor
any other adjective, really, except perhaps "static duration" if
one is talking about normal usage by typical C compilers).
>But I want to know what .romdata,.COMMON,.appreset sections will
contain and what is the usage of It
The "sbss" section is generally used for small BSS items. A COMMON
section is probably used for COMMON items (e.g., by a Fortran
compiler). Sections named .gnu.<somethingare used by GNU utilities.
There is no fixed limit on the number and/or spelling of the various
sections, and with a properly programmable linker, each section
can be manipulated in whatever way the person programming the linker
desires.

Some C compilers have extensions that allow the now-not-quite-C
programmer to place particular entities into arbitrary sections.
For instance, in GNU-C, you can write:

int x __attribute((section("helloworld")));

puts x into the "helloworld" section (which you just created, and
which your linker script is likely to ignore, causing the variable
to be discarded at link time).
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (4039.22'N, 11150.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 6 '06 #4

P: n/a
Hi Chris,

Thanks for the valueble reply.

I have one more doubt. Now I am taking about the C compliers

..data will contains global and static Initialised data
..bss will contains the Uninitialised global data

data and bss will not only contain global data but also the variables
which we use inside the
funtion, is it that memory also will be taken from these segments.
please correct me if i am wrong.

Thanks for the reply,
Sundeep
Chris Torek wrote:
In article <11**********************@m73g2000cwd.googlegroups .com>
sunny <su********@gmail.comwrote:
When objdump command is executed It has displayed so many
sections(segments) in the output
.data , .bss , .sbss , .rodata, .romdata, .COMMON, .appreset

I came to know that the following segments usage

.data - Intialised Global Data
.bss - UnIntialised Global Data
.rodata - read only data

"Global" is an inappropriate adjective. These two section names
can be said to contain "initialized data" and "uninitialized data",
but said data is neither specifically "global" nor "local" (nor
any other adjective, really, except perhaps "static duration" if
one is talking about normal usage by typical C compilers).
But I want to know what .romdata,.COMMON,.appreset sections will
contain and what is the usage of It

The "sbss" section is generally used for small BSS items. A COMMON
section is probably used for COMMON items (e.g., by a Fortran
compiler). Sections named .gnu.<somethingare used by GNU utilities.
There is no fixed limit on the number and/or spelling of the various
sections, and with a properly programmable linker, each section
can be manipulated in whatever way the person programming the linker
desires.

Some C compilers have extensions that allow the now-not-quite-C
programmer to place particular entities into arbitrary sections.
For instance, in GNU-C, you can write:

int x __attribute((section("helloworld")));

puts x into the "helloworld" section (which you just created, and
which your linker script is likely to ignore, causing the variable
to be discarded at link time).
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (4039.22'N, 11150.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 6 '06 #5

P: n/a
In article <11**********************@f16g2000cwb.googlegroups .com>,
sunny <su********@gmail.comwrote:
>I have one more doubt. Now I am taking about the C compliers
>.data will contains global and static Initialised data
.bss will contains the Uninitialised global data
data and bss will not only contain global data but also the variables
which we use inside the
funtion, is it that memory also will be taken from these segments.
please correct me if i am wrong.
A) You are wrong; and
B) As previously indicated, this is very specific to your implementation
and not something suitable for comp.lang.c, which deals with the
C language itself, not with peculiarities of implementations.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Nov 6 '06 #6

P: n/a

Hi,

I have one more doubt,

How to create a user defined sections from C code.
and how we will have control of the variables to store in the
respective section.

Example : Let consider I have created a section .sundeep
I want the global varibal "a" to store in this section.
How we can do it?

Thanks in advance

Regards,
Sundeep

Nov 10 '06 #7

P: n/a
sunny wrote:
How to create a user defined sections from C code.
and how we will have control of the variables to store in the
respective section.

Example : Let consider I have created a section .sundeep
I want the global varibal "a" to store in this section.
How we can do it?
Using whatever implementation-specific tools are available. C itself
doesn't have "sections", and so doesn't offer control of them.

--
Chris ".enable proofreading" Dollin
"- born in the lab under strict supervision -", - Magenta, /Genetesis/

Nov 10 '06 #8

P: n/a
In article <11*********************@m7g2000cwm.googlegroups.c om>,
sunny <su********@gmail.comwrote:
>I have one more doubt,
>How to create a user defined sections from C code.
and how we will have control of the variables to store in the
respective section.
I'm running out of creative ways to say ASK ELSEWHERE.

"sections" or "segments" are NOT part of C, they are part of
your particular implementation. Ask people who know about
your implementation.
>Example : Let consider I have created a section .sundeep
I want the global varibal "a" to store in this section.
How we can do it?
"we" cannot do it at all. "we" don't use whatever compiler and
operating system that you do, and on -our- compiler and operating
system, the same concepts are handled in very different ways that would
be useless to describe to you because they are not what -your-
implementation does.

--
Okay, buzzwords only. Two syllables, tops. -- Laurie Anderson
Nov 10 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.