OLD | NEW |
1 /* $Id:$ | 1 /* $Id:$ |
2 * ELF object machine specific format helpers | 2 * ELF object machine specific format helpers |
3 * | 3 * |
4 * Copyright (C) 2004-2007 Michael Urman | 4 * Copyright (C) 2004-2007 Michael Urman |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 26 matching lines...) Expand all Loading... |
37 assert(yasm_intnum_check_size(i, 64, 0, 2)); \ | 37 assert(yasm_intnum_check_size(i, 64, 0, 2)); \ |
38 yasm_intnum_get_sized(i, p, 8, 64, 0, 0, 0); \ | 38 yasm_intnum_get_sized(i, p, 8, 64, 0, 0, 0); \ |
39 p += 8; } while (0) | 39 p += 8; } while (0) |
40 | 40 |
41 #define YASM_WRITE_64C_L(p, hi, lo) do {\ | 41 #define YASM_WRITE_64C_L(p, hi, lo) do {\ |
42 YASM_WRITE_32_L(p, lo); \ | 42 YASM_WRITE_32_L(p, lo); \ |
43 YASM_WRITE_32_L(p, hi); } while (0) | 43 YASM_WRITE_32_L(p, hi); } while (0) |
44 | 44 |
45 #define YASM_WRITE_64Z_L(p, i) YASM_WRITE_64C_L(p, 0, i) | 45 #define YASM_WRITE_64Z_L(p, i) YASM_WRITE_64C_L(p, 0, i) |
46 | 46 |
47 typedef int(*func_accepts_reloc)(size_t val, yasm_symrec *wrt, | 47 typedef int(*func_accepts_reloc)(size_t val, yasm_symrec *wrt); |
48 yasm_symrec **ssyms); | |
49 typedef void(*func_write_symtab_entry)(unsigned char *bufp, | 48 typedef void(*func_write_symtab_entry)(unsigned char *bufp, |
50 elf_symtab_entry *entry, | 49 elf_symtab_entry *entry, |
51 yasm_intnum *value_intn, | 50 yasm_intnum *value_intn, |
52 yasm_intnum *size_intn); | 51 yasm_intnum *size_intn); |
53 typedef void(*func_write_secthead)(unsigned char *bufp, elf_secthead *shead); | 52 typedef void(*func_write_secthead)(unsigned char *bufp, elf_secthead *shead); |
54 typedef void(*func_write_secthead_rel)(unsigned char *bufp, | 53 typedef void(*func_write_secthead_rel)(unsigned char *bufp, |
55 elf_secthead *shead, | 54 elf_secthead *shead, |
56 elf_section_index symtab_idx, | 55 elf_section_index symtab_idx, |
57 elf_section_index sindex); | 56 elf_section_index sindex); |
58 | 57 |
59 typedef void(*func_handle_reloc_addend)(yasm_intnum *intn, | 58 typedef void(*func_handle_reloc_addend)(yasm_intnum *intn, |
60 elf_reloc_entry *reloc); | 59 elf_reloc_entry *reloc, |
61 typedef unsigned int(*func_map_reloc_info_to_type)(elf_reloc_entry *reloc, | 60 unsigned long offset); |
62 yasm_symrec **ssyms); | 61 typedef unsigned int(*func_map_reloc_info_to_type)(elf_reloc_entry *reloc); |
63 typedef void(*func_write_reloc)(unsigned char *bufp, | 62 typedef void(*func_write_reloc)(unsigned char *bufp, |
64 elf_reloc_entry *reloc, | 63 elf_reloc_entry *reloc, |
65 unsigned int r_type, | 64 unsigned int r_type, |
66 unsigned int r_sym); | 65 unsigned int r_sym); |
67 typedef void (*func_write_proghead)(unsigned char **bufpp, | 66 typedef void (*func_write_proghead)(unsigned char **bufpp, |
68 elf_offset secthead_addr, | 67 elf_offset secthead_addr, |
69 unsigned long secthead_count, | 68 unsigned long secthead_count, |
70 elf_section_index shstrtab_index); | 69 elf_section_index shstrtab_index); |
71 | 70 |
72 enum { | 71 enum { |
(...skipping 27 matching lines...) Expand all Loading... |
100 func_write_reloc write_reloc; | 99 func_write_reloc write_reloc; |
101 func_write_proghead write_proghead; | 100 func_write_proghead write_proghead; |
102 | 101 |
103 const elf_machine_ssym *ssyms; /* array of "special" syms */ | 102 const elf_machine_ssym *ssyms; /* array of "special" syms */ |
104 const size_t num_ssyms; /* size of array */ | 103 const size_t num_ssyms; /* size of array */ |
105 | 104 |
106 const int bits; /* usually 32 or 64 */ | 105 const int bits; /* usually 32 or 64 */ |
107 }; | 106 }; |
108 | 107 |
109 #endif /* ELF_MACHINE_H_INCLUDED */ | 108 #endif /* ELF_MACHINE_H_INCLUDED */ |
OLD | NEW |