[Bug ld/11426] ld/configure.host does not behave as expected if /bin/sh is dash and not bash

2010-03-24 Thread amodra at gmail dot com

--- Additional Comments From amodra at gmail dot com  2010-03-25 04:06 
---
Proposed patch http://sourceware.org/ml/binutils/2010-03/msg00373.html

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11426

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug binutils/11430] nm crashes when handling some lib file.

2010-03-24 Thread hzgmaxwell at sohu dot com

--- Additional Comments From hzgmaxwell at sohu dot com  2010-03-25 03:25 
---
Created an attachment (id=4679)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4679&action=view)
diff file for bfd/coffcode.h


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11430

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug binutils/11430] New: nm crashes when handling some lib file.

2010-03-24 Thread hzgmaxwell at sohu dot com
When listing symbols in a lib file, it crashed here.

#0  coff_slurp_symbol_table (abfd=0x16e3888) at coffcode.h:4519
#1  0x0040f9fc in coff_get_symtab_upper_bound (abfd=0x16e3888) at coffgen.c:338
#2  0x004057ac in _bfd_generic_read_minisymbols (abfd=0x16e3888, dynamic=0,
minisymsp=0xe2cc60, sizep=0xe2cc5c) at syms.c:808
#3  0x0040268e in display_rel_file (abfd=0x16e3888, archive_bfd=0x166b0e0) at
nm.c:1006
#4  0x00402b15 in display_archive (file=0x166b0e0) at nm.c:1147
#5  0x00402c2e in display_file (filename=0xe2cd6d "/d/WebCoreediting.lib") at
nm.c:1195
#6  0x004037d0 in main (argc=2, argv=0x166ae40) at nm.c:1661

Here is the code, the sym variable got a value as 1,
  /* FIXME: We should not be casting between ints and
 pointers like this.  */
  sym = ((coff_symbol_type *)
 ((symndx + obj_raw_syments (abfd))
  ->u.syment._n._n_n._n_zeroes));


then it crashed at
if (sym->lineno != NULL && ! warned)


I'm proposing a solution as below, to check the sym after setting its value.

  //brook
  if(sym < obj_symbols (abfd) ) {
  _bfd_error_handler (_("%B: warning: illegal symbol address %x,
which should be greater than %x"),
  abfd, sym, obj_symbols (abfd));
  continue;
  }

-- 
   Summary: nm crashes when handling some lib file.
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: hzgmaxwell at sohu dot com
CC: bug-binutils at gnu dot org
 GCC build triplet: cygwin
  GCC host triplet: mingw32
GCC target triplet: mingw32


http://sourceware.org/bugzilla/show_bug.cgi?id=11430

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug ld/11426] ld/configure.host does not behave as expected if /bin/sh is dash and not bash

2010-03-24 Thread amodra at gmail dot com


-- 
   What|Removed |Added

 AssignedTo|unassigned at sources dot   |amodra at gmail dot com
   |redhat dot com  |
 Status|NEW |ASSIGNED
   Last reconfirmed|-00-00 00:00:00 |2010-03-25 02:15:20
   date||


http://sourceware.org/bugzilla/show_bug.cgi?id=11426

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug binutils/11337] windres compiles menus and dialogs to UNICODE not ANSI

2010-03-24 Thread ron at ronware dot org

--- Additional Comments From ron at ronware dot org  2010-03-24 20:39 
---
(In reply to comment #2)
> Hi Ron,
> 
>   Have you tried using the --codepage= switch to windres ?  (I think 
> that a
> value of 1252 might work.  Either that or 0).
> 

I have indeed tried that, to no avail.  What did work was reverting to windres
2.18.  So something between .18 and .20 messed this up.

I've resent the zip including the resource.h now.

Best regards,
Ron

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11337

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug binutils/11337] windres compiles menus and dialogs to UNICODE not ANSI

2010-03-24 Thread ron at ronware dot org

--- Additional Comments From ron at ronware dot org  2010-03-24 20:37 
---
Created an attachment (id=4678)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4678&action=view)
Original RC file, good .o and bad .o -- second attempt (includes resource.h)


-- 
   What|Removed |Added

Attachment #4639 is|0   |1
   obsolete||


http://sourceware.org/bugzilla/show_bug.cgi?id=11337

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug ld/11426] ld/configure.host does not behave as expected if /bin/sh is dash and not bash

2010-03-24 Thread schwab at linux-m68k dot org

--- Additional Comments From schwab at linux-m68k dot org  2010-03-24 14:27 
---
Trying to get backslashes through echo is bound to fail.

:
"If any of the operands contain a  character, the results are
implementation-defined."

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11426

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug ld/11426] ld/configure.host does not behave as expected if /bin/sh is dash and not bash

2010-03-24 Thread ian at airs dot com

--- Additional Comments From ian at airs dot com  2010-03-24 13:11 ---
Created an attachment (id=4676)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4676&action=view)
Patch

I think a more reliable patch would be something like this, which changes \1 to
\\1.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11426

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


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


[Bug ld/11426] New: ld/configure.host does not behave as expected if /bin/sh is dash and not bash

2010-03-24 Thread mgretton at sourceware dot org
For arm-none-linux-gnueabi ld/configure.host (from CVS HEAD as of 23 March 2010)
executes the following sequence of commands to set HOSTING_CRT0 to the correct
value:

HOSTING_CRT0='-p -dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld[^
]*\.so" | sed -e "s,.*-dynamic-linker[  ][  ]*\(.*/ld[^ ]*\.so..\).*,\1,"`
`${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f
../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC}
--print-file-name=crtbegin.o; fi`'
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`

When executed in bash HOSTING_CRT0 is now equal to:
-p -dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld-linux\.so" | sed -e
"s,.*-dynamic-linker[   ][  ]*\(.*/ld-linux\.so..\).*,\1,"` `${CC}
--print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f
../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC}
--print-file-name=crtbegin.o; fi`

But with dash it is equal to:
-p -dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld-linux\.so" | sed -e
"s,.*-dynamic-linker[   ][  ]*\(.*/ld-linux\.so..\).*,^A,"` `${CC}
--print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f
../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC}
--print-file-name=crtbegin.o; fi`

(Where ^A is the character with value 1).

This then causes many ld tests to fail if /bin/sh is linked to dash instead of
bash (as is the case for Ubuntu).

My reading of POSIX says that the output of:
echo "\1" 
is implementation defined and so dash's behaviour is acceptable, (as is in this
case bash's).

I believe this issue also affects other targets including x86_64 and mips.

A workaround for these issues is to make the first "exec sh ..." in
get_link_files in ld/testsuite/config/default.exp be "exec bash ..." instead.

ld tests that fail if sh is dash instead of bash are:
Running /home/mgretton/binutils/src/ld/testsuite/ld-bootstrap/bootstrap.exp ...
FAIL: bootstrap
FAIL: bootstrap with strip
FAIL: bootstrap with --traditional-format
FAIL: bootstrap with --no-keep-memory
FAIL: bootstrap with --relax
Running /home/mgretton/binutils/src/ld/testsuite/ld-cdtest/cdtest.exp ...
FAIL: cdtest
FAIL: cdtest with -Ur
Running /home/mgretton/binutils/src/ld/testsuite/ld-elf/dwarf.exp ...
FAIL: Run with libdwarf1.so first
FAIL: Run with libdwarf1.so last
Running /home/mgretton/binutils/src/ld/testsuite/ld-elf/elf.exp ...
FAIL: preinit array
FAIL: init array
FAIL: fini array
Running /home/mgretton/binutils/src/ld/testsuite/ld-elf/shared.exp ...
FAIL: Run normal with libfoo.so
FAIL: Run protected with libfoo.so
FAIL: Run hidden with libfoo.so
FAIL: Run normal with versioned libfoo.so
FAIL: Run warn with versioned libfoo.so
FAIL: Run protected with versioned libfoo.so
FAIL: Run hidden with versioned libfoo.so
FAIL: Run normal libbar.so with libfoo.so
FAIL: Run protected libbar.so with libfoo.so
FAIL: Run hidden libbar.so with libfoo.so
FAIL: Run normal libbar.so with versioned libfoo.so
FAIL: Run protected libbar.so with versioned libfoo.so
FAIL: Run hidden libbar.so with versioned libfoo.so
FAIL: Run dl1a with --dynamic-list=dl1.list and dlopen on libdl1.so
FAIL: Run dl1b with --dynamic-list-data and dlopen on libdl1.so
FAIL: Run with libdl2a.so
FAIL: Run with libdl2b.so
FAIL: Run with libdl2c.so
FAIL: Run with libdl4a.so
FAIL: Run with libdl4b.so
FAIL: Run with libdl4c.so
FAIL: Run with libdl4d.so
FAIL: Run with libdl4e.so
FAIL: Run with libdl4f.so
FAIL: Run dl6a1 with --dynamic-list-data and dlopen on libdl6a.so
FAIL: Run dl6a2 with -Bsymbolic-functions and dlopen on libdl6a.so
FAIL: Run dl6a3 with -Bsymbolic and dlopen on libdl6a.so
FAIL: Run dl6a4 with -Bsymbolic --dynamic-list-data and dlopen on libdl6a.so
FAIL: Run dl6a5 with -Bsymbolic-functions --dynamic-list-cpp-new and dlopen on
libdl6a.so
FAIL: Run dl6a6 with --dynamic-list-cpp-new -Bsymbolic-functions and dlopen on
libdl6a.so
FAIL: Run dl6a7 with --dynamic-list-data -Bsymbolic and dlopen on libdl6a.so
FAIL: Run dl6b1 with --dynamic-list-data and dlopen on libdl6b.so
FAIL: Run dl6b2 with dlopen on libdl6b.so
FAIL: Run dl6c1 with --dynamic-list-data and dlopen on libdl6c.so
FAIL: Run dl6d1 with --dynamic-list-data and dlopen on libdl6d.so
FAIL: Run with libdata1.so
FAIL: Run with libfunc1.so comm1.o
FAIL: Run with comm1.o libfunc1.so
FAIL: Run with pr11138-2.c libpr11138-1.so
FAIL: Run with libpr11138-1.so pr11138-2.c

-- 
   Summary: ld/configure.host does not behave as expected if /bin/sh
is dash and not bash
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: mgretton at sourceware dot org
CC: bug-binutils at gnu dot org
  GCC host triplet: arm-none-linux-gnueabi
GCC target triplet: arm-none-linux-gnueabi


http://sourceware.org/bugzilla/show_bug.cgi?id=11426

--- You a