快乐虾
http://blog.youkuaiyun.com/lights_joy/
lights@hb165.com
本文适用于
bfinutils-2.19
vs2008
visual dsp++ 5.0
欢迎转载,但请保留作者信息
vdsp中的doj文件采用的是elf格式,但是做了一些扩展,其中.attributes是额外添加上去的一个section,它的section head可取如下值:
| table 0 | 属性值 | 附加说明 |
| sh_name | 17 | Section name, index in string tbl |
| sh_type | STRTAB | Type of section |
| sh_flags | 0x00000000 | Miscellaneous section attributes |
| sh_addr | 0x00000000 | Section virtual addr at execution |
| sh_offset | 24173 | Section file offset |
| sh_size | 248 | Size of section in bytes |
| sh_link | 0 | Index of another section |
| sh_info | 0x00000000 | Additional section information |
| sh_addralign | 0 | Section alignment |
| sh_entsize | 0 | Entry size if section holds table |
它的sh_type值为STRTAB,也即是说这个段中只存储字符串列表。按STRTAB将它的内容展开:
| table 0 | 起始位置 | 字符串值 |
| 1 | 0 | |
| 2 | 1 | ProjectName common |
| 3 | 20 | ProjectName common |
| 4 | 39 | FuncName _env_get_addr |
| 5 | 62 | FuncName _env_get_char_memory |
| 6 | 92 | FuncName _env_crc_update |
| 7 | 117 | FuncName _env_get_char_init |
| 8 | 145 | FuncName _env_relocate |
| 9 | 168 | FuncName _env_complete |
| 10 | 191 | Content CodeData |
| 11 | 208 | si-revision 0.3 |
| 12 | 224 | processor-id ADSP-BF561 |
很明显,每一行都定义了一个attribute,用/t将属性的名称和值分开,这样,上表的内容就可以解释为:
| table 0 | 属性名称 | 属性值 |
| 1 | ProjectName | common |
| 2 | ProjectName | common |
| 3 | FuncName | _env_get_addr |
| 4 | FuncName | _env_get_char_memory |
| 5 | FuncName | _env_crc_update |
| 6 | FuncName | _env_get_char_init |
| 7 | FuncName | _env_relocate |
| 8 | FuncName | _env_complete |
| 9 | Content | CodeData |
| 10 | si-revision | 0.3 |
| 11 | processor-id | ADSP-BF561 |
参考资料
bfd对多目标的支持( 2008-9-25 )
bfd对elf32格式的支持( 2008-11-7 )
objdump与readelf的区别( 2008-11-10 )
objdump代码分析( 2008-11-10 )
bfd的文件格式识别( 2008-11-10 )
bfd的后端数据表示( 2008-11-10 )
Bfd中的内存泄漏( 2008-11-13 )
Bfd对elf文件头的处理( 2008-11-27 )
在bfd中添加处理vdsp文件的target( 2008-11-27 )
doj中的扩展section: .commandLine( 2008-11-28 )
本文详细介绍了vdsp中的.doj文件所使用的elf格式及其扩展section .attributes的具体内容。通过对该段的深入分析,揭示了其存储的字符串列表及对应的属性信息。
4万+

被折叠的 条评论
为什么被折叠?



