Changeset 0d073b8 in mainline
- Timestamp:
- 2019-04-06T11:46:44Z (6 years ago)
- Children:
- a4bd537
- Parents:
- b59836d5
- git-author:
- Petr Pavlu <setup@…> (2019-03-31 13:00:13)
- git-committer:
- Petr Pavlu <setup@…> (2019-04-06 11:46:44)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/elf.h
rb59836d5 r0d073b8 245 245 246 246 /** 247 * Dynamic array tags 248 */ 249 enum elf_dynamic_tag { 250 DT_NULL = 0, 251 DT_NEEDED = 1, 252 DT_PLTRELSZ = 2, 253 DT_PLTGOT = 3, 254 DT_HASH = 4, 255 DT_STRTAB = 5, 256 DT_SYMTAB = 6, 257 DT_RELA = 7, 258 DT_RELASZ = 8, 259 DT_RELAENT = 9, 260 DT_STRSZ = 10, 261 DT_SYMENT = 11, 262 DT_INIT = 12, 263 DT_FINI = 13, 264 DT_SONAME = 14, 265 DT_RPATH = 15, 266 DT_SYMBOLIC = 16, 267 DT_REL = 17, 268 DT_RELSZ = 18, 269 DT_RELENT = 19, 270 DT_PLTREL = 20, 271 DT_DEBUG = 21, 272 DT_TEXTREL = 22, 273 DT_JMPREL = 23, 274 DT_BIND_NOW = 24, 275 DT_LOPROC = 0x70000000, 276 DT_HIPROC = 0x7fffffff, 277 }; 278 279 /** 280 * Special section indexes 281 */ 282 enum { 283 SHN_UNDEF = 0, 284 SHN_LORESERVE = 0xff00, 285 SHN_LOPROC = 0xff00, 286 SHN_HIPROC = 0xff1f, 287 SHN_ABS = 0xfff1, 288 SHN_COMMON = 0xfff2, 289 SHN_HIRESERVE = 0xffff, 290 }; 291 292 /** 293 * Special symbol table index 294 */ 295 enum { 296 STN_UNDEF = 0, 297 }; 298 299 /** 247 300 * ELF data types 248 301 * … … 406 459 }; 407 460 461 /** 462 * Dynamic structure 463 */ 464 struct elf32_dyn { 465 elf_sword d_tag; 466 union { 467 elf_word d_val; 468 elf32_addr d_ptr; 469 } d_un; 470 }; 471 472 struct elf64_dyn { 473 elf_sxword d_tag; 474 union { 475 elf_xword d_val; 476 elf64_addr d_ptr; 477 } d_un; 478 }; 479 480 struct elf32_rel { 481 elf32_addr r_offset; 482 elf_word r_info; 483 }; 484 485 struct elf32_rela { 486 elf32_addr r_offset; 487 elf_word r_info; 488 elf_sword r_addend; 489 }; 490 491 struct elf64_rel { 492 elf64_addr r_offset; 493 elf_xword r_info; 494 }; 495 496 struct elf64_rela { 497 elf64_addr r_offset; 498 elf_xword r_info; 499 elf_sxword r_addend; 500 }; 501 502 #define ELF32_R_SYM(i) ((i) >> 8) 503 #define ELF32_R_TYPE(i) ((unsigned char)(i)) 504 505 #define ELF64_R_SYM(i) ((i) >> 32) 506 #define ELF64_R_TYPE(i) ((i) & 0xffffffffL) 507 408 508 #ifdef __32_BITS__ 409 509 typedef struct elf32_header elf_header_t; … … 412 512 typedef struct elf32_symbol elf_symbol_t; 413 513 typedef struct elf32_note elf_note_t; 514 typedef struct elf32_dyn elf_dyn_t; 515 typedef struct elf32_rel elf_rel_t; 516 typedef struct elf32_rela elf_rela_t; 414 517 #endif 415 518 … … 420 523 typedef struct elf64_symbol elf_symbol_t; 421 524 typedef struct elf64_note elf_note_t; 525 typedef struct elf64_dyn elf_dyn_t; 526 typedef struct elf64_rel elf_rel_t; 527 typedef struct elf64_rela elf_rela_t; 422 528 #endif 423 529 -
uspace/lib/c/include/rtld/elf_dyn.h
rb59836d5 r0d073b8 39 39 #include <libarch/rtld/elf_dyn.h> 40 40 41 #define ELF32_R_SYM(i) ((i) >> 8)42 #define ELF32_R_TYPE(i) ((unsigned char)(i))43 44 #define ELF64_R_SYM(i) ((i) >> 32)45 #define ELF64_R_TYPE(i) ((i) & 0xffffffffL)46 47 struct elf32_dyn {48 elf_sword d_tag;49 union {50 elf_word d_val;51 elf32_addr d_ptr;52 } d_un;53 };54 55 struct elf64_dyn {56 elf_sxword d_tag;57 union {58 elf_xword d_val;59 elf64_addr d_ptr;60 } d_un;61 };62 63 struct elf32_rel {64 elf32_addr r_offset;65 elf_word r_info;66 };67 68 struct elf32_rela {69 elf32_addr r_offset;70 elf_word r_info;71 elf_sword r_addend;72 };73 74 struct elf64_rel {75 elf64_addr r_offset;76 elf_xword r_info;77 };78 79 struct elf64_rela {80 elf64_addr r_offset;81 elf_xword r_info;82 elf_sxword r_addend;83 };84 85 #ifdef __32_BITS__86 typedef struct elf32_dyn elf_dyn_t;87 typedef struct elf32_rel elf_rel_t;88 typedef struct elf32_rela elf_rela_t;89 #endif90 91 #ifdef __64_BITS__92 typedef struct elf64_dyn elf_dyn_t;93 typedef struct elf64_rel elf_rel_t;94 typedef struct elf64_rela elf_rela_t;95 #endif96 97 /*98 * Dynamic array tags99 */100 #define DT_NULL 0101 #define DT_NEEDED 1102 #define DT_PLTRELSZ 2103 #define DT_PLTGOT 3104 #define DT_HASH 4105 #define DT_STRTAB 5106 #define DT_SYMTAB 6107 #define DT_RELA 7108 #define DT_RELASZ 8109 #define DT_RELAENT 9110 #define DT_STRSZ 10111 #define DT_SYMENT 11112 #define DT_INIT 12113 #define DT_FINI 13114 #define DT_SONAME 14115 #define DT_RPATH 15116 #define DT_SYMBOLIC 16117 #define DT_REL 17118 #define DT_RELSZ 18119 #define DT_RELENT 19120 #define DT_PLTREL 20121 #define DT_DEBUG 21122 #define DT_TEXTREL 22123 #define DT_JMPREL 23124 #define DT_BIND_NOW 24125 #define DT_LOPROC 0x70000000126 #define DT_HIPROC 0x7fffffff127 128 /*129 * Special section indexes130 */131 #define SHN_UNDEF 0132 #define SHN_LORESERVE 0xff00133 #define SHN_LOPROC 0xff00134 #define SHN_HIPROC 0xff1f135 #define SHN_ABS 0xfff1136 #define SHN_COMMON 0xfff2137 #define SHN_HIRESERVE 0xffff138 139 /*140 * Special symbol table index141 */142 #define STN_UNDEF 0143 144 41 #endif 145 42
Note:
See TracChangeset
for help on using the changeset viewer.