[PATCH] gas: bad output of double pseudo instruction

Bosco García jbgg.gnu@gmail.com
Tue Aug 20 19:45:00 GMT 2019


Is there any problem with this patch?
Is this the right place to submit it?
Thank you.


El sáb., 17 ago. 2019 a las 3:38, Bosco García (<jbgg.gnu@gmail.com>) escribió:
>
> Some numbers are interpreted in bad way by function atof_general.
> The next POC is shown:
>
> $ cat << EOF | as -o test -- && objdump -s test
>   .data
>   .double .0000000000000000000001
>   .double 1e-22
> EOF
>
> The output is:
>
> test:     file format elf64-x86-64
>
> Contents of section .data:
>  0000 00000000 00000000 e65e1710 20395e3b  .........^.. 9^;
>
> Where we note that the same number is interpreted different,
> in this case the output of the first form is bad.
>
> The reason of this bug is the function atof_general which assumes,
> when the number of digits is calculated, that the ``left'' zeros are
> deleted, but this is not the case for the zeros after decimal mark.
>
> The next patch fix this problem by skipping all zeros at the ``left'' side,
> when there is zero after decimal mark then they are skipped and an
> appropiate decimal_exponent is calculated for the shift which is then
> propertly added to the final variable decimal_exponent.



More information about the Binutils mailing list