Need some information in output of objdump

Discussion in 'C Programming' started by sunny, Nov 6, 2006.

  1. sunny

    sunny Guest

    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
    sunny, Nov 6, 2006
    #1
    1. Advertising

  2. "sunny" <> writes:
    > 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) <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.
    Keith Thompson, Nov 6, 2006
    #2
    1. Advertising

  3. In article <>,
    sunny <> wrote:

    >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
    Walter Roberson, Nov 6, 2006
    #3
  4. sunny

    Chris Torek Guest

    In article <>
    sunny <> wrote:
    >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).
    --
    In-Real-Life: Chris Torek, Wind River Systems
    Salt Lake City, UT, USA (40°39.22'N, 111°50.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.
    Chris Torek, Nov 6, 2006
    #4
  5. sunny

    sunny Guest

    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 <>
    > sunny <> wrote:
    > >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).
    > --
    > In-Real-Life: Chris Torek, Wind River Systems
    > Salt Lake City, UT, USA (40°39.22'N, 111°50.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.
    sunny, Nov 6, 2006
    #5
  6. In article <>,
    sunny <> wrote:

    >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
    Walter Roberson, Nov 6, 2006
    #6
  7. sunny

    sunny Guest

    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
    sunny, Nov 10, 2006
    #7
  8. sunny

    Chris Dollin Guest

    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/
    Chris Dollin, Nov 10, 2006
    #8
  9. In article <>,
    sunny <> wrote:

    >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
    Walter Roberson, Nov 10, 2006
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    665
    Guest
    Feb 25, 2004
  2. z. f.
    Replies:
    0
    Views:
    667
    z. f.
    Feb 3, 2005
  3. Holmes!
    Replies:
    2
    Views:
    420
    Malcolm Dew-Jones
    Apr 2, 2005
  4. Domino
    Replies:
    5
    Views:
    370
    dorayme
    Nov 5, 2006
  5. Benoit Lefebvre
    Replies:
    11
    Views:
    1,206
    Kenneth Brody
    Dec 10, 2007
Loading...

Share This Page