Liste des Groupes | Revenir à cl c |
On Fri, 31 May 2024 19:03:10 +0100
bart <bc@freeuk.com> wrote:
>OK, thanks. But I forget to ask what results you got from running the>
program. Because if I try your code, using hello.c and hello.exe as
test binary/source data, I get this output:
>
_binary_test_bi_start 00007ff6497620e0
140695771160800 _binary_test_bi_end
00007ff649762ae0 140695771163360 _binary_test_bi_size
00007ff509750a00 140690402380288 _binary_bin_to_list_c_start
00007ff649762ae0 140695771163360 _binary_bin_to_list_c_end
00007ff649762b26 140695771163430
_binary_bin_to_list_c_size 00007ff509750046
140690402377798
>
The sizes should have been 2560 and 70 respectively; those values are
bit bigger than that.
That's strange. I got expected results:
_binary_test_bi_start 000000013FDD30C0 5366427840
_binary_test_bi_end 000000013FDD67AC 5366441900
_binary_test_bi_size 00000000000036EC 14060
_binary_bin_to_list_c_start 000000013FDD67AC 5366441900
_binary_bin_to_list_c_end 000000013FDD711F 5366444319
_binary_bin_to_list_c_size 0000000000000973 2419
>However I see that you also have start and end addresses, which>
sounds a much better way of determining the size. (In that case, what
are those *size symbols for?).
I'd guess, *_size is here for the benefit of less smart compilers that
can not figure out that *_end - *_start is a connst expression
and can not compile code like:
>
static ptrdiff_t bar = _binary_test_bi_end - _binary_test_bi_start;
Les messages affichés proviennent d'usenet.