Take the 2-minute tour ×
Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It's 100% free, no registration required.

Test is on Linux 32bit.

I use this command to get the context of .text .rodata and .data section:

objdump -s -j .text elf_binary
objdump -s -j .rodata elf_binary
objdump -s -j .data elf_binary

But basically when I tried to use this to get the content of .bss section, I always get the error shown below:

objdump -s -j .bss elf_binary

objdump: section '.bss' mentioned in a -j option, but not found in any input file

Basically how can I get the content of .bss section from ELF binary?

share|improve this question
add comment

2 Answers 2

up vote 14 down vote accepted

The .bss has no content. It's simply a tip to the loader to preallocate some space when starting the program. It will be all 0s at the execution and won't hold any useful information until the program writes to it. After that, you can use a debugger to dump the memory and explore its content.

Check the Wikipedia page for more information.

share|improve this answer
add comment

The .bss block started by symbol (also called Uninitialized data segment - bss is an old assembly instruction on an ancient IBM chip) section is supposed to contain global variables and static variables uninitialized or initialized to 0 or NULL. The .bss section is usually non existing until your program starts executing, this is why you can't retrieve its content statically. It is fairly important to note that this section helps reduce the program's size & makes it quicker to load.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.