Re: 'final link failed: Bad value' when building Linux/MIPS kernels.

2007-03-16 Thread H. J. Lu
On Fri, Mar 16, 2007 at 09:09:39AM -0400, Paul Koning wrote:
> > "Steven" == Steven J Hill <[EMAIL PROTECTED]> writes:
> 
>  Steven> Greetings.  I have been chasing down a binutils regression
>  Steven> that is preventing me from building a Linux/MIPS kernel using
>  Steven> a gcc-4.2 based toolchain. Here is the snippet of output when
>  Steven> building a 2.6.12 kernel for my platform:
> 
>  Steven>  LD  drivers/mtd/maps/built-in.o
>  Steven>  LD  drivers/mtd/nand/built-in.o
>  Steven>  LD  drivers/mtd/built-in.o
>  Steven>mipsel-linux-uclibc-ld: final link failed: Bad value
>  Steven>make[1]: *** [drivers/mtd/built-in.o] Error 1
>  Steven>make: *** [_module_drivers/mtd] Error 2
> 
> I've run into the same message when building things for a NetBSD/MIPS
> target.   I had assumed it was some error on my end.  
> 
> The problem with this message is that it is completely content-free.
> It doesn't contain a meaningful problem statement, and it doesn't say
> anything at all about where the problem is.  It doesn't even indicate
> what input file triggered the problem!   How is a user supposed to fix
> a failed build when this error message appears?  

Please file a bug report with all input files for the linker. I
will at least provide clear diagnostic messages.


H.J.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: 'final link failed: Bad value' when building Linux/MIPS kernels.

2007-03-15 Thread H. J. Lu
On Thu, Mar 15, 2007 at 09:35:42PM -0500, Steven J. Hill wrote:
> Greetings.
> 
> I have been chasing down a binutils regression that is preventing me from
> building a Linux/MIPS kernel using a gcc-4.2 based toolchain. Here is the
> snippet of output when building a 2.6.12 kernel for my platform:
> 
>  LD  drivers/mtd/maps/built-in.o
>  LD  drivers/mtd/nand/built-in.o
>  LD  drivers/mtd/built-in.o
>mipsel-linux-uclibc-ld: final link failed: Bad value
>make[1]: *** [drivers/mtd/built-in.o] Error 1
>make: *** [_module_drivers/mtd] Error 2
> 
> The versions were:
> 
>binutils-2.17.50.0.12
>gcc-4.2-20070131
>linux-headers-2.6.12
> 
> Using the release version of binutils-2.17 works fine and does not
> produce the error above. However, binutils-HEAD out of today's CVS
> and all of H.J. Lu's development releases > 2.17.50.0.3 will produce
> the error. The regression appeared in binutils-2.17.50.0.4 and still
> exists. The simple patch is:
> 
>--- binutils-2.17.50.0.12/bfd/elfxx-mips.c
>+++ binutils-2.17.50.0.12-patched/bfd/elfxx-mips.c
>@@ -3603,12 +3603,9 @@
>  const Elf_Internal_Rela *relocation,
>  const Elf_Internal_Rela *relend)
> {
>-  unsigned long r_symndx = ELF_R_SYM (abfd, relocation->r_info);
>-
>   while (relocation < relend)
> {
>-  if (ELF_R_TYPE (abfd, relocation->r_info) == r_type
>- && ELF_R_SYM (abfd, relocation->r_info) == r_symndx)
>+  if (ELF_R_TYPE (abfd, relocation->r_info) == r_type)
>return relocation;
> 
>   ++relocation;
> 
> I applied to binutils-HEAD and was then able to build a valid Linux/MIPS
> kernel and applications. I need to move on to other items, but if someone
> could comment or have a look at this, it would be much appreciated. If a
> better formatted bug report should be submitted somewhere, just let me
> know. Thanks.

I suggest you open a bug report with all input files for
drivers/mtd/built-in.o and drivers/mtd/.built-in.o.cmd. You can find
input filenames in drivers/mtd/.built-in.o.cmd. 


H.J.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: /usr/bin/ld: unrecognized option '--as-needed'

2006-05-14 Thread H. J. Lu
On Sat, May 13, 2006 at 10:07:18PM -0400, Hypatia Rojas wrote:
> Hi,
> I am getting the following error:
> 
> c97b1mn32:/usr/src/linux-2.6.5-7.244 # make prepare cloneconfig
> Makefile:438: .config: No such file or directory
> make[1]: Nothing to be done for `Makefile'.
> Makefile:438: .config: No such file or directory
>   HOSTCC  scripts/basic/fixdep
> /usr/bin/ld: unrecognized option '--as-needed'
> /usr/bin/ld: use the --help option for usage information
> collect2: ld returned 1 exit status
> make[3]: *** [scripts/basic/fixdep] Error 1
> make[2]: *** [scripts_basic] Error 2
> make[1]: *** [include/linux/autoconf.h] Error 2
> make: *** [prepare] Error 2

Your binutils is too old.


H.J.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: monitor instruction bug?

2005-10-10 Thread H. J. Lu
On Mon, Oct 10, 2005 at 04:01:10PM -0400, root wrote:
> actually none of these bug reports are out of context.
> i have an assembler file with every instruction in the intel docs
> (we need a comprehensive test case) and
> i'm just reporting the actual output from objdump.
> 
> perhaps it's a version issue. which version are you using?
> if all else fails i can send you my assembler code file.
> 

The current binutils 2.16.1 should be OK. If not, open a bug report at

http://www.sourceware.org/bugzilla/


H.J.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: monitor instruction bug?

2005-10-10 Thread H. J. Lu
On Mon, Oct 10, 2005 at 03:13:12PM -0400, root wrote:
> 
>   mwait  ; 0F 01 C9
> 
> generates:
> 
>   0f sidt (bad)
>   01 c9  add ecx,ecx
> 
> 
> (ref: p3-556 IA-32 Intel Architecture Software Developer's Manual
>  Vol 2A: Instruction Set Reference, A-M Order Number 253666)
> 

You can't take a byte out of context for ia32 instruction. I have no
problem:

[EMAIL PROTECTED] tmp]$ cat 1.s
pause
monitor
mwait
[EMAIL PROTECTED] tmp]$ gcc -c 1.s -m32
[EMAIL PROTECTED] tmp]$ objdump -d 1.o

1.o: file format elf32-i386

Disassembly of section .text:

 <.text>:
   0:   f3 90   pause
   2:   0f 01 c8monitor %eax,%ecx,%edx
   5:   0f 01 c9mwait  %eax,%ecx


H.J.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils