This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: What's the meaning of some messages issued by objdump


Parmenides <mobile.parmenides@gmail.com> writes:

>    The command line is like this
>                           objdump -h tst.o
> and the messages as follows
>
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>   0 .text         0000005e  00000000  00000000  00000034  2**2
>                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
>   1 .data         00000008  00000000  00000000  00000094  2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>   2 .bss          00000004  00000000  00000000  0000009c  2**2
>                   ALLOC
>   3 .rodata       00000004  00000000  00000000  0000009c  2**0
>                   CONTENTS, ALLOC, LOAD, READONLY, DATA
>   4 .comment      00000012  00000000  00000000  000000a0  2**0
>                   CONTENTS, READONLY
>   5 .note.GNU-stack 00000000  00000000  00000000  000000b2  2**0
>                   CONTENTS, READONLY
>
> What's the meaning of CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE,
> DATA. I can not get the
> explanation from the manual.

The exact meaning depends on the object file format that you are using.

In general:

CONTENTS: The section has data associated with it.  In ELF, this
generally corresponds to a section type of SHT_PROGBITS.

ALLOC: Memory should be allocated for the section at runtime.  In ELF,
this corresponds to the section flag SHF_ALLOC.

LOAD: The section should be loaded into memory at runtime.  In ELF, this
corresponds to the flag SHF_ALLOC plus the type SHT_PROGBITS.

RELOC: The section has relocation entries.  In ELF, this means there is
a SHT_REL or SHT_RELA section which links to this section.

READONLY: The section should be marked as readonly at runtime.  In ELF,
this corresponds to the absence of the SHF_WRITE flag.

CODE: The section contains instructions to be executed.  In ELF, this
corresponds to the SHF_EXECINSTR flag.

DATA: The section contains data which is not executed.  In ELF, this
corresponds to the absence of the SHF_EXECINSTR flag.

See the source file bfd/bfd-in2.h for more comments.

Ian


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