Need some information in output of objdump

S

sunny

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
 
K

Keith Thompson

sunny said:
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.
 
W

Walter Roberson

sunny said:
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.)
 
C

Chris Torek

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.<something> are 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).
 
S

sunny

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
 
W

Walter Roberson

sunny said:
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.
 
S

sunny

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
 
C

Chris Dollin

sunny said:
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.
 
W

Walter Roberson

sunny said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top