This patch http://sourceware.org/ml/binutils/2001-01/msg00108.html added DISASSEMBLER_NEEDS_RELOCS based in the enabled targets at configure time. It has several problems: 1. It isn't enabled for --enable-targets=all. 2. Objdump for i386 now has 2 different assemblers, depending on if the enabled target defines DISASSEMBLER_NEEDS_RELOCS or not. 3. The i386 assembler works incorrectly when ARM is enabled since the assembler is different due to DISASSEMBLER_NEEDS_RELOCS. [hjl@gnu-13 testsuite]$ cat y.s .text glob: jmp ext jmp weak [hjl@gnu-13 testsuite]$ gcc -c -m32 y.s [hjl@gnu-13 testsuite]$ ../../binutils/objdump -d y.o y.o: file format elf32-i386 Disassembly of section .text: 00000000 <glob>: 0: e9 fc ff ff ff jmp 1 <glob+0x1> 5: e9 fc ff ff ff jmp 6 <weak+0x6> ^^^^ It should be "glob". which leads to "make check" failure on Linux/x86 when --enable-targets=arm-linux is used. I think DISASSEMBLER_NEEDS_RELOCS should be fixed and it should be enabled at run-time depending on targets, if needed, instead of configure time.
Subject: Re: New: DISASSEMBLER_NEEDS_RELOCS doesn't work correctly Hi H.J. > added DISASSEMBLER_NEEDS_RELOCS based in the enabled targets at configure > time. It has several problems: > > 1. It isn't enabled for --enable-targets=all. True, although I am not sure if this is a serious problem. > 2. Objdump for i386 now has 2 different assemblers, depending on if the > enabled target defines DISASSEMBLER_NEEDS_RELOCS or not. This point has me confused. Do you mean 2 different *assemblers* or 2 different *disassemblers* ? > 3. The i386 assembler works incorrectly when ARM is enabled since the assembler > is different due to DISASSEMBLER_NEEDS_RELOCS. Just how common is it to build such a toolchain I wonder. Most people would only build a single-targeted toolchain not a multiply targeted toolchain like the one you mention above. > which leads to "make check" failure on Linux/x86 when > --enable-targets=arm-linux is used. Which failure is this ? > I think DISASSEMBLER_NEEDS_RELOCS should be fixed and it should be enabled > at run-time depending on targets, if needed, instead of configure time. Well this is a reasonable request and should be too hard to do. The patch ought to be sure that relocs are not read in unnecessarily and that the absence of relocs does not prevent disassembly, but otherwise it should be quite straightforward. Please feel free to submit a suitable patch. Cheers Nick
I meant "disassemblers", not "assemblers". With "-enable-targets=arm-linux", I got FAIL: i386 pcrel reloc FAIL: i386 gotpc FAIL: i386 dynamic tls on Linux/x86. I think even with DISASSEMBLER_NEEDS_RELOCS defined, ia32 disassembler output should be the same. I suspect the bug is in implementation of DISASSEMBLER_NEEDS_RELOCS. I can give it a try. But since I don't know the reason behind it, I may not be able to fix it correctly.
Fixed with <http://sourceware.org/ml/binutils/2006-01/msg00134.html>.