|
23 | 23 | #undef sort_mcount_loc
|
24 | 24 | #undef elf_mcount_loc
|
25 | 25 | #undef do_sort
|
26 |
| -#undef uint_t |
27 | 26 | #undef ehdr_shoff
|
28 | 27 | #undef ehdr_shentsize
|
29 | 28 | #undef ehdr_shstrndx
|
|
39 | 38 | #undef sym_name
|
40 | 39 | #undef sym_value
|
41 | 40 | #undef sym_shndx
|
| 41 | +#undef long_size |
42 | 42 |
|
43 | 43 | #ifdef SORTTABLE_64
|
44 | 44 | # define extable_ent_size 16
|
|
47 | 47 | # define sort_mcount_loc sort_mcount_loc_64
|
48 | 48 | # define elf_mcount_loc elf_mcount_loc_64
|
49 | 49 | # define do_sort do_sort_64
|
50 |
| -# define uint_t uint64_t |
51 | 50 | # define ehdr_shoff ehdr64_shoff
|
52 | 51 | # define ehdr_shentsize ehdr64_shentsize
|
53 | 52 | # define ehdr_shstrndx ehdr64_shstrndx
|
|
63 | 62 | # define sym_name sym64_name
|
64 | 63 | # define sym_value sym64_value
|
65 | 64 | # define sym_shndx sym64_shndx
|
| 65 | +# define long_size 8 |
66 | 66 | #else
|
67 | 67 | # define extable_ent_size 8
|
68 | 68 | # define compare_extable compare_extable_32
|
69 | 69 | # define get_mcount_loc get_mcount_loc_32
|
70 | 70 | # define sort_mcount_loc sort_mcount_loc_32
|
71 | 71 | # define elf_mcount_loc elf_mcount_loc_32
|
72 | 72 | # define do_sort do_sort_32
|
73 |
| -# define uint_t uint32_t |
74 | 73 | # define ehdr_shoff ehdr32_shoff
|
75 | 74 | # define ehdr_shentsize ehdr32_shentsize
|
76 | 75 | # define ehdr_shstrndx ehdr32_shstrndx
|
|
86 | 85 | # define sym_name sym32_name
|
87 | 86 | # define sym_value sym32_value
|
88 | 87 | # define sym_shndx sym32_shndx
|
| 88 | +# define long_size 4 |
89 | 89 | #endif
|
90 | 90 |
|
91 | 91 | #if defined(SORTTABLE_64) && defined(UNWINDER_ORC_ENABLED)
|
@@ -193,25 +193,25 @@ pthread_t mcount_sort_thread;
|
193 | 193 | struct elf_mcount_loc {
|
194 | 194 | Elf_Ehdr *ehdr;
|
195 | 195 | Elf_Shdr *init_data_sec;
|
196 |
| - uint_t start_mcount_loc; |
197 |
| - uint_t stop_mcount_loc; |
| 196 | + uint64_t start_mcount_loc; |
| 197 | + uint64_t stop_mcount_loc; |
198 | 198 | };
|
199 | 199 |
|
200 | 200 | /* Sort the addresses stored between __start_mcount_loc to __stop_mcount_loc in vmlinux */
|
201 | 201 | static void *sort_mcount_loc(void *arg)
|
202 | 202 | {
|
203 | 203 | struct elf_mcount_loc *emloc = (struct elf_mcount_loc *)arg;
|
204 |
| - uint_t offset = emloc->start_mcount_loc - shdr_addr(emloc->init_data_sec) |
| 204 | + uint64_t offset = emloc->start_mcount_loc - shdr_addr(emloc->init_data_sec) |
205 | 205 | + shdr_offset(emloc->init_data_sec);
|
206 |
| - uint_t count = emloc->stop_mcount_loc - emloc->start_mcount_loc; |
| 206 | + uint64_t count = emloc->stop_mcount_loc - emloc->start_mcount_loc; |
207 | 207 | unsigned char *start_loc = (void *)emloc->ehdr + offset;
|
208 | 208 |
|
209 |
| - qsort(start_loc, count/sizeof(uint_t), sizeof(uint_t), compare_extable); |
| 209 | + qsort(start_loc, count/long_size, long_size, compare_extable); |
210 | 210 | return NULL;
|
211 | 211 | }
|
212 | 212 |
|
213 | 213 | /* Get the address of __start_mcount_loc and __stop_mcount_loc in System.map */
|
214 |
| -static void get_mcount_loc(uint_t *_start, uint_t *_stop) |
| 214 | +static void get_mcount_loc(uint64_t *_start, uint64_t *_stop) |
215 | 215 | {
|
216 | 216 | FILE *file_start, *file_stop;
|
217 | 217 | char start_buff[20];
|
@@ -277,8 +277,8 @@ static int do_sort(Elf_Ehdr *ehdr,
|
277 | 277 | unsigned int shstrndx;
|
278 | 278 | #ifdef MCOUNT_SORT_ENABLED
|
279 | 279 | struct elf_mcount_loc mstruct = {0};
|
280 |
| - uint_t _start_mcount_loc = 0; |
281 |
| - uint_t _stop_mcount_loc = 0; |
| 280 | + uint64_t _start_mcount_loc = 0; |
| 281 | + uint64_t _stop_mcount_loc = 0; |
282 | 282 | #endif
|
283 | 283 | #if defined(SORTTABLE_64) && defined(UNWINDER_ORC_ENABLED)
|
284 | 284 | unsigned int orc_ip_size = 0;
|
|
0 commit comments