[beyes@beyes ELF]$ objcopy -I binary -O elf32-i386 -B i386 mypic.jpg temp.o
[beyes@beyes ELF]$ objdump -t temp.o
temp.o: file format elf32-i386
SYMBOL TABLE:
00000000 l d .data 00000000 .data
00000000 g .data 00000000 _binary_mypic_jpg_start
00011855 g .data 00000000 _binary_mypic_jpg_end
00011855 g *ABS* 00000000 _binary_mypic_jpg_size
#include <stdio.h>
__attribute__((section("myvarsection"))) int global_var = 18;
__attribute__((section("myfuncsection"))) void hello(void);
void hello(void)
{
printf ("hello world\n");
printf ("my global_var:%d\n", global_var);
}
int main()
{
hello();
return 0;
}
[beyes@beyes ELF]$ objdump -h sefsec.o
sefsec.o: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000012 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 00000048 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 00000048 2**2
ALLOC
3 myvarsection 00000004 00000000 00000000 00000048 2**2
CONTENTS, ALLOC, LOAD, DATA
4 .rodata 0000001e 00000000 00000000 0000004c 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 myfuncsection 0000002b 00000000 00000000 0000006a 2**0
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
6 .comment 0000002e 00000000 00000000 00000095 2**0
CONTENTS, READONLY
7 .note.GNU-stack 00000000 00000000 00000000 000000c3 2**0
CONTENTS, READONLY
8 .eh_frame 00000058 00000000 00000000 000000c4 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |