[Bug gold/14897] New: gold is installed by accident

2012-11-30 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14897

 Bug #: 14897
   Summary: gold is installed by accident
   Product: binutils
   Version: 2.24 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
AssignedTo: i...@airs.com
ReportedBy: hjl.to...@gmail.com
CC: ccout...@google.com
Classification: Unclassified


Only "--disable-ld" or "--enable-gold=default" should install
gold as default ld.  However, gold/configure.ac has:

default_ld=
AC_ARG_ENABLE(ld,
[[  --enable-ld[=ARG] build ld [ARG={default,yes,no}]]],
[case "${enableval}" in
  default)
default_ld=ld.bfd
;;  
esac])

It will install gold as default ld for --enable-gold.  As
the result, when --enable-gold is used, we get random
default ld, depending which directory, gold or ld, is
installed the last.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

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


[Bug gold/14897] gold is installed as default ld by accident

2012-11-30 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14897

H.J. Lu  changed:

   What|Removed |Added

Summary|gold is installed by|gold is installed as
   |accident|default ld by accident

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

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


[Bug gold/14897] gold is installed as default ld by accident

2012-11-30 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14897

H.J. Lu  changed:

   What|Removed |Added

URL||http://sourceware.org/ml/bi
   ||nutils/2012-11/msg00447.htm
   ||l

--- Comment #1 from H.J. Lu  2012-11-30 17:45:04 
UTC ---
A patch is posted at

http://sourceware.org/ml/binutils/2012-11/msg00447.html

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

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


[Bug gas/14899] New: Missing gas dependency for ld and gold

2012-11-30 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14899

 Bug #: 14899
   Summary: Missing gas dependency for ld and gold
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
AssignedTo: unassig...@sourceware.org
ReportedBy: hjl.to...@gmail.com
Classification: Unclassified


When bootstrap GCC and binutils in a combined-tree,
gcc/as has

RIGINAL_AS_FOR_TARGET="../gas/as-new"
ORIGINAL_LD_FOR_TARGET="../gold/ld-new"
ORIGINAL_LD_BFD_FOR_TARGET="../ld/ld-new"
ORIGINAL_LD_GOLD_FOR_TARGET="../gold/ld-new"
ORIGINAL_PLUGIN_LD_FOR_TARGET="../gold/ld-new"
ORIGINAL_NM_FOR_TARGET="../binutils/nm-new"
exeext=
fast_install=yes
objdir=.libs

invoked=`basename "$0"`
id=$invoked
case "$invoked" in
  as)
original=$ORIGINAL_AS_FOR_TARGET
prog=as-new$exeext
dir=gas
;;

ld and gold must be built after gas.  Otherwise, we will
get

/export/build/gnu/tools-4.8/build-x86_64-linux/./prev-gcc/xg++
-B/export/build/gnu/tools-4.8/build-x86_64-linux/./prev-gcc/
-B/usr/tools-4.8.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++
-B/export/build/gnu/tools-4.8/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/export/build/gnu/tools-4.8/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/export/build/gnu/tools-4.8/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/export/build/gnu/tools-4.8/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include
-I/export/gnu/src/tools-4.8/tools/libstdc++-v3/libsupc++
-L/export/build/gnu/tools-4.8/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/export/build/gnu/tools-4.8/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-DHAVE_CONFIG_H -I. -I/export/gnu/src/tools-4.8/tools/gold 
-I/export/gnu/src/tools-4.8/tools/gold
-I/export/gnu/src/tools-4.8/tools/gold/../include
-I/export/gnu/src/tools-4.8/tools/gold/../elfcpp
-DLOCALEDIR="\"/usr/tools-4.8.0/share/locale\""
-DBINDIR="\"/usr/tools-4.8.0/bin\""
-DTOOLBINDIR="\"/usr/tools-4.8.0/x86_64-unknown-linux-gnu/bin\""
-DTOOLLIBDIR="\"/usr/tools-4.8.0/x86_64-unknown-linux-gnu/lib\""   -W -Wall   
-Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=nacl.o -g -O2
-MT nacl.o -MD -MP -MF .deps/nacl.Tpo -c -o nacl.o
/export/gnu/src/tools-4.8/tools/gold/nacl.cc
/export/build/gnu/tools-4.8/build-x86_64-linux/./prev-gcc/as: line 97:
/export/build/gnu/tools-4.8/build-x86_64-linux/prev-gcc/../gas/as-new: Text
file busy
make[6]: *** [nacl.o] Error 1

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

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


[Bug gas/14899] Missing gas dependency for ld and gold

2012-11-30 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14899

H.J. Lu  changed:

   What|Removed |Added

URL||http://sourceware.org/ml/bi
   ||nutils/2012-11/msg00449.htm
   ||l
Version|unspecified |2.24 (HEAD)

--- Comment #1 from H.J. Lu  2012-11-30 19:51:15 
UTC ---
A patch is posted at

http://sourceware.org/ml/binutils/2012-11/msg00449.html

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

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


[Bug binutils/14902] New: h8300-elf linker relaxations: symbols skipped

2012-11-30 Thread achille.fouilleul+binutils at gadz dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=14902

 Bug #: 14902
   Summary: h8300-elf linker relaxations: symbols skipped
   Product: binutils
   Version: 2.23
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassig...@sourceware.org
ReportedBy: achille.fouilleul+binut...@gadz.org
Classification: Unclassified


Created attachment 6767
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6767
proposed fix (don't forget to remove the fprintfs)

With binutils 2.23.1, configured with --target=h8300-elf

When relaxations are applied, symbols located after the last instruction of a
.text section do not get updated as they should.

$ cat a.s 
.h8300s
.text
.globl _start
.globl _a
.globl _a_end
_start:
_a:
sub r0,r0
jmp @_a
sub r1,r1
jmp @_b
sub r2,r2
_a_end:

$ cat b.s 
.h8300s
.text
.globl _b
_b:
sub r0,r0
jmp @_a
sub r1,r1
jmp @_b
sub r2,r2
jmp @_a_end
_b_end:

$ cat Makefile 
AS = h8300-elf-as
LD = h8300-elf-ld

result.elf: a.o b.o
$(LD) --relax -mh8300self $^ -o $@

.PHONY: clean

clean:
-rm -f *.o *.elf

.s.o:
$(AS) $< -o $@


Assemble and link the files above (Makefile provided for convenience), then run
h8300-elf-objdump -dr result.elf:

result.elf: file format elf32-h8300


Disassembly of section .text:

0100 <_a>:
 100:19 00   sub.wr0,r0
 102:40 fc   bra.-4 (0x100)
 104:19 11   sub.wr1,r1
 106:40 02   bra.+2 (0x10a)
 108:19 22   sub.wr2,r2

010a <_b>:
 10a:19 00   sub.wr0,r0
 10c:40 f2   bra.-14 (0x100)

010e <_a_end>:
 10e:19 11   sub.wr1,r1
 110:40 f8   bra.-8 (0x10a)
 112:19 22   sub.wr2,r2
 114:40 f8   bra.-8 (0x10e)

The _a_end symbol has not been adjusted. One problem with this bug is that gcc
often places labels at the end of .text sections; with midly complex programs
and linker scripts, this has led to incorrect code being generated.

I think the problem is in the elf32_h8_relax_delete_bytes() function
(elf32-h8300.c); symbol values are always compared strictly with toaddr. I
think the <= operator should be used instead. The attached patch seems to fix
the issue:

result.elf: file format elf32-h8300


Disassembly of section .text:

0100 <_a>:
 100:19 00   sub.wr0,r0
 102:40 fc   bra.-4 (0x100)
 104:19 11   sub.wr1,r1
 106:40 02   bra.+2 (0x10a)
 108:19 22   sub.wr2,r2

010a <_a_end>:
 10a:19 00   sub.wr0,r0
 10c:40 f2   bra.-14 (0x100)
 10e:19 11   sub.wr1,r1
 110:40 f8   bra.-8 (0x10a)
 112:19 22   sub.wr2,r2
 114:40 f4   bra.-12 (0x10a)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

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


[Bug gas/14899] Missing gas dependency for ld and gold

2012-11-30 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14899

--- Comment #2 from H.J. Lu  2012-12-01 01:39:35 
UTC ---
In stage 2, prev-gcc/as has

ORIGINAL_AS_FOR_TARGET="../gas/as-new"
...
dir=gas
prog=as-new

if test -x $scriptdir/../$dir/$prog; then
  exec $scriptdir/../$dir/$prog
else
  exec $scriptdir/../prev-$dir/$prog 
fi

When we are building gas parallel with bintils,
gold, gprof and ld, we may run into race condition
that prev-gcc/as checks ../gas/as-new at the same
time when we are creating it.  So we must build
gas before other binutils programs.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

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