Liste des Groupes | Revenir à cl c |
On 01/06/2024 23:11, Michael S wrote:On Fri, 31 May 2024 22:15:54 +0100
bart <bc@freeuk.com> wrote:
If I run this:
>
printf("%p\n", &_binary_hello_c_start);
printf("%p\n", &_binary_hello_c_end);
printf("%p\n", &_binary_hello_c_size);
>
I get:
>
00007ff6ef252010
00007ff6ef252056
00007ff5af240046
>
I can see that the first two can be subtracted to give the sizes of
the data, which is 70 or 0x46. 0x46 is the last byte of the address
of _size, so what's happening there? What's with the crap in bits
16-47?
It looks like ASLR. I don't see it because I test on Win7.
I understand those are high-loading addresses. I was asking what they
were doing as part of the size.
Apparently, that size value is wrongly relocated by some versions of
gcc-ld. Since allocations work on 64KB blocks, that explains why the
bottom 16 bits are unaffected.
So such a size value could still be used for objects up 64KB-1, but
it sounds dodgy.
Les messages affichés proviennent d'usenet.