Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
RT-Thread
rt-thread
提交
a25dbad3
R
rt-thread
项目概览
RT-Thread
/
rt-thread
8 个月 前同步成功
通知
750
Star
8909
Fork
4735
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a25dbad3
编写于
9月 11, 2021
作者:
B
BernardXiong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libdl] fix formatting issue
上级
8da9f78d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
47 addition
and
59 deletion
+47
-59
components/libc/libdl/dlelf.h
components/libc/libdl/dlelf.h
+47
-59
未找到文件。
components/libc/libdl/dlelf.h
浏览文件 @
a25dbad3
...
...
@@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2018/08/29 Bernard first version
* 2021/04/23 chunyexixiaoyu
distinguish 32-bit and 64-bit
* Date Author
Notes
* 2018/08/29 Bernard
first version
* 2021/04/23 chunyexixiaoyu distinguish 32-bit and 64-bit
*/
#ifndef DL_ELF_H__
...
...
@@ -20,14 +20,14 @@ typedef rt_int32_t Elf32_Sword; /* Signed large integer */
typedef
rt_uint32_t
Elf32_Word
;
/* Unsigned large integer */
typedef
rt_uint16_t
Elf32_Half
;
/* Unsigned medium integer */
typedef
rt_uint64_t
Elf64_Addr
;
typedef
rt_uint16_t
Elf64_Half
;
typedef
rt_int16_t
Elf64_SHalf
;
typedef
rt_uint64_t
Elf64_Off
;
typedef
rt_int32_t
Elf64_Sword
;
typedef
rt_uint32_t
Elf64_Word
;
typedef
rt_uint64_t
Elf64_Xword
;
typedef
rt_int64_t
Elf64_Sxword
;
typedef
rt_uint64_t
Elf64_Addr
;
typedef
rt_uint16_t
Elf64_Half
;
typedef
rt_int16_t
Elf64_SHalf
;
typedef
rt_uint64_t
Elf64_Off
;
typedef
rt_int32_t
Elf64_Sword
;
typedef
rt_uint32_t
Elf64_Word
;
typedef
rt_uint64_t
Elf64_Xword
;
typedef
rt_int64_t
Elf64_Sxword
;
typedef
rt_uint16_t
Elf64_Section
;
/* e_ident[] magic number */
...
...
@@ -86,24 +86,24 @@ typedef struct elfhdr
header string table" entry offset */
}
Elf32_Ehdr
;
typedef
struct
elf64_hdr
{
unsigned
char
e_ident
[
EI_NIDENT
];
/* ELF Identification */
Elf64_Half
e_type
;
/* object file type */
Elf64_Half
e_machine
;
/* machine */
Elf64_Word
e_version
;
/* object file version */
Elf64_Addr
e_entry
;
/* virtual entry point */
Elf64_Off
e_phoff
;
/* program header table offset */
Elf64_Off
e_shoff
;
/* section header table offset */
Elf64_Word
e_flags
;
/* processor-specific flags */
Elf64_Half
e_ehsize
;
/* ELF header size */
Elf64_Half
e_phentsize
;
/* program header entry size */
Elf64_Half
e_phnum
;
/* number of program header entries */
Elf64_Half
e_shentsize
;
/* section header entry size */
Elf64_Half
e_shnum
;
/* number of section header entries */
Elf64_Half
e_shstrndx
;
/* section header table's "section
typedef
struct
elf64_hdr
{
unsigned
char
e_ident
[
EI_NIDENT
];
/* ELF Identification */
Elf64_Half
e_type
;
/* object file type */
Elf64_Half
e_machine
;
/* machine */
Elf64_Word
e_version
;
/* object file version */
Elf64_Addr
e_entry
;
/* virtual entry point */
Elf64_Off
e_phoff
;
/* program header table offset */
Elf64_Off
e_shoff
;
/* section header table offset */
Elf64_Word
e_flags
;
/* processor-specific flags */
Elf64_Half
e_ehsize
;
/* ELF header size */
Elf64_Half
e_phentsize
;
/* program header entry size */
Elf64_Half
e_phnum
;
/* number of program header entries */
Elf64_Half
e_shentsize
;
/* section header entry size */
Elf64_Half
e_shnum
;
/* number of section header entries */
Elf64_Half
e_shstrndx
;
/* section header table's "section
header string table" entry offset */
}
Elf64_Ehdr
;
}
Elf64_Ehdr
;
/* Section Header */
typedef
struct
...
...
@@ -123,19 +123,18 @@ typedef struct
typedef
struct
{
Elf64_Word
sh_name
;
/* Section name (string tbl index) */
Elf64_Word
sh_type
;
/* Section type */
Elf64_Xword
sh_flags
;
/* Section flags */
Elf64_Addr
sh_addr
;
/* Section virtual addr at execution */
Elf64_Off
sh_offset
;
/* Section file offset */
Elf64_Xword
sh_size
;
/* Section size in bytes */
Elf64_Word
sh_link
;
/* Link to another section */
Elf64_Word
sh_info
;
/* Additional section information */
Elf64_Xword
sh_addralign
;
/* Section alignment */
Elf64_Xword
sh_entsize
;
/* Entry size if section holds table */
Elf64_Word
sh_name
;
/* Section name (string tbl index) */
Elf64_Word
sh_type
;
/* Section type */
Elf64_Xword
sh_flags
;
/* Section flags */
Elf64_Addr
sh_addr
;
/* Section virtual addr at execution */
Elf64_Off
sh_offset
;
/* Section file offset */
Elf64_Xword
sh_size
;
/* Section size in bytes */
Elf64_Word
sh_link
;
/* Link to another section */
Elf64_Word
sh_info
;
/* Additional section information */
Elf64_Xword
sh_addralign
;
/* Section alignment */
Elf64_Xword
sh_entsize
;
/* Entry size if section holds table */
}
Elf64_Shdr
;
/* Section names */
#define ELF_BSS ".bss"
/* uninitialized data */
#define ELF_DATA ".data"
/* initialized data */
...
...
@@ -171,19 +170,16 @@ typedef struct elf32_sym
Elf32_Half
st_shndx
;
/* section header index */
}
Elf32_Sym
;
typedef
struct
{
Elf64_Word
st_name
;
/* Symbol name (string tbl index) */
unsigned
char
st_info
;
/* Symbol type and binding */
unsigned
char
st_other
;
/* Symbol visibility */
Elf64_Section
st_shndx
;
/* Section index */
Elf64_Addr
st_value
;
/* Symbol value */
Elf64_Xword
st_size
;
/* Symbol size */
Elf64_Word
st_name
;
/* Symbol name (string tbl index) */
unsigned
char
st_info
;
/* Symbol type and binding */
unsigned
char
st_other
;
/* Symbol visibility */
Elf64_Section
st_shndx
;
/* Section index */
Elf64_Addr
st_value
;
/* Symbol value */
Elf64_Xword
st_size
;
/* Symbol size */
}
Elf64_Sym
;
#define STB_LOCAL 0
/* BIND */
#define STB_GLOBAL 1
#define STB_WEAK 2
...
...
@@ -244,8 +240,6 @@ typedef struct
#define ELF32_R_TYPE(i) ((unsigned char) (i))
#define ELF32_R_INFO(s,t) (((s) << 8) + (unsigned char)(t))
#define ELF64_R_SYM(i) ((i) >> 32)
#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
...
...
@@ -296,7 +290,6 @@ typedef struct
Elf32_Word
p_align
;
/* memory alignment */
}
Elf32_Phdr
;
typedef
struct
{
Elf64_Word
p_type
;
/* Segment type */
...
...
@@ -309,10 +302,6 @@ typedef struct
Elf64_Xword
p_align
;
/* Segment alignment */
}
Elf64_Phdr
;
/* p_type */
#define PT_NULL 0
#define PT_LOAD 1
...
...
@@ -384,10 +373,9 @@ typedef Elf64_Sym Elf_Sym;
typedef
Elf64_Rela
Elf_Rel
;
typedef
Elf64_Addr
Elf_Addr
;
#endif
int
dlmodule_relocate
(
struct
rt_dlmodule
*
module
,
Elf_Rel
*
rel
,
Elf_Addr
sym_val
);
rt_err_t
dlmodule_load_shared_object
(
struct
rt_dlmodule
*
module
,
void
*
module_ptr
);
rt_err_t
dlmodule_load_relocated_object
(
struct
rt_dlmodule
*
module
,
void
*
module_ptr
);
int
dlmodule_relocate
(
struct
rt_dlmodule
*
module
,
Elf_Rel
*
rel
,
Elf_Addr
sym_val
);
rt_err_t
dlmodule_load_shared_object
(
struct
rt_dlmodule
*
module
,
void
*
module_ptr
);
rt_err_t
dlmodule_load_relocated_object
(
struct
rt_dlmodule
*
module
,
void
*
module_ptr
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录