On 28/04/11 02:30, Barry Song wrote:
I am using the newest binary utils(2.21) and encounted the following ASSERT in arm_elf32.c:
if (out_attr[i].i == 0)
{
BFD_ASSERT (out_attr[Tag_ABI_HardFP_use].i == 0);
[...]
But not sure whether it is a bug.
I should say that it is a bug because asserts are there to catch bugs. If it were checking the input were valid then it would give a diagnostic message. That said, it may be that the bug *is* that a diagnostic should be used instead of an assert. :)
In this case 'i' will be 'Tag_FP_arch', so the code is saying that if Tag_FP_arch is not set, then set that and set Tag_ABI_HardFP_use at the same time. Since this is the only place Tag_ABI_HardFP_use is ever set, it should not be possible to have it set without Tag_FP_arch also being set, so if the assert triggers then something is broken.
So, the question is, what is setting the tags this way? Assuming the code is ok, the only other way it could happen is in a malformed input file.
Now, the reason this is an assert, and not a diagnostic, is probably because the tags are not considered "user input". Yes, the user can set them via assembler directives, but the assembler is supposed to make sure they are valid before creating the object file.
Could you please run the broken link again with "-Wl,-t" (trace) and record all the input files the linker uses, and check what attributes (tags) are set on those files using "readelf -A".
I suspect that you may have a mal-formed binary on your system (possibly created by an older version of binutils).
Andrew