[Bug ld/13990] New: ld/ld-new: BFD assertion fail, elf32-arm.c:12259 with --gc-sections and --shared, GCing a PLT reference to a local symbol

2012-04-18 Thread hp at sourceware dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=13990

 Bug #: 13990
   Summary: ld/ld-new: BFD assertion fail, elf32-arm.c:12259 with
--gc-sections and --shared, GCing a PLT reference to a
local symbol
   Product: binutils
   Version: 2.23 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sourceware.org
ReportedBy: h...@sourceware.org
Classification: Unclassified
Target: arm-linux-gnueabi


Building libstdc++.so.6 from the gcc-4.7 branch with current binutils will
yield the following assertions, but the linker will create what seems like a
correct DSO.

/tmp/somewhere/o/ld/ld-new: BFD (GNU Binutils) 2.22.52.20120416 assertion fail
/tmp/somewhere/src/bfd/elf32-arm.c:12259
/tmp/somewhere/o/ld/ld-new: BFD (GNU Binutils) 2.22.52.20120416 assertion fail
/tmp/somewhere/src/bfd/elf32-arm.c:12259
/tmp/somewhere/o/ld/ld-new: BFD (GNU Binutils) 2.22.52.20120416 assertion fail
/tmp/somewhere/src/bfd/elf32-arm.c:12259
/tmp/somewhere/o/ld/ld-new: BFD (GNU Binutils) 2.22.52.20120416 assertion fail
/tmp/somewhere/src/bfd/elf32-arm.c:12259

Again, you may notice this only by inspecting the build log.
Patch in progress; will send it and reduced test-case to the list.

-- 
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 ld/13991] New: powerpc-rtems ld failure [regression]

2012-04-18 Thread joel.sherrill at oarcorp dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13991

 Bug #: 13991
   Summary: powerpc-rtems ld failure [regression]
   Product: binutils
   Version: 2.22
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sourceware.org
ReportedBy: joel.sherr...@oarcorp.com
Classification: Unclassified


Created attachment 6348
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6348
Test case

This is a test case which demonstrates that something changed with ld between
binutils 2.10.1 and 2.22 which resulted in a number of our BSPs not being able
to do the transform from an ELF file to a compressed binary with a bootloader
header. I have attached an unfortunately large file with the binaries that
generate this failure.

rtems 4.10 - binutils 2.20.1 with patches
rtems 4.11 - binutils 2.22 with no patches

With the same set of binary files to link.

-bash-4.2$  /opt/rtems-4.10/bin/powerpc-rtems4.10-ld -o hello.ralf bootloader.o
--just-symbols=hello.exe -b binary rtems.gz -T ppcboot.lds 

-bash-4.2$  /opt/rtems-4.11/bin/powerpc-rtems4.11-ld -o hello.ralf bootloader.o
--just-symbols=hello.exe -b binary rtems.gz -T ppcboot.lds 
ppcboot.lds:97: undefined symbol `__rtems_start' referenced in expression

-bash-4.2$ powerpc-rtems4.10-nm -g hello.exe | grep rtems_start
 T __rtems_start

The symbol is there but not found by the reference in ppcboot.lds.

=

These is the RTEMS RPM information so this can be traced to that.

-bash-4.2$ rpm -qf /opt/rtems-4.10/bin/powerpc-rtems4.10-ld
rtems-4.10-powerpc-rtems4.10-binutils-2.20.1-3.fc16.i686

-bash-4.2$ rpm -qf /opt/rtems-4.11/bin/powerpc-rtems4.11-ld
rtems-4.11-powerpc-rtems4.11-binutils-2.22-1.fc16.i686

=

-- 
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 ld/13991] powerpc-rtems ld failure [regression]

2012-04-18 Thread joel.sherrill at oarcorp dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13991

Joel Sherrill  changed:

   What|Removed |Added

 Target||powerpc-rtems

-- 
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 ld/13991] powerpc-rtems ld failure [regression]

2012-04-18 Thread joel.sherrill at oarcorp dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13991

Joel Sherrill  changed:

   What|Removed |Added

 CC||ralf.corsepius at rtems dot
   ||org

-- 
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 ld/13990] ld/ld-new: BFD assertion fail, elf32-arm.c:12259 with --gc-sections and --shared, GCing a PLT reference to a local symbol

2012-04-18 Thread hp at sourceware dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=13990

Hans-Peter Nilsson  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
URL||http://sourceware.org/ml/bi
   ||nutils/2012-04/msg00228.htm
   ||l
 AssignedTo|unassigned at sourceware|hp at sourceware dot org
   |dot org |

-- 
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 gprof/13993] New: gprof failed to accumulate hist time

2012-04-18 Thread manjian2006 at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13993

 Bug #: 13993
   Summary: gprof failed to accumulate hist time
   Product: binutils
   Version: 2.22
Status: NEW
  Severity: normal
  Priority: P2
 Component: gprof
AssignedTo: unassig...@sourceware.org
ReportedBy: manjian2...@gmail.com
Classification: Unclassified


This bug occurred in hist_assign_samples_1 which is located in hist.c.When
bin_high_pc < sym_low_pc was true at first hit,the variable j kept decreasing
until it overflowed.No symbol would be find in this situation.The following is
my fix of this bug,may harm the  performance.


static void
hist_assign_samples_1 (histogram *r)
{
  bfd_vma bin_low_pc, bin_high_pc;
  bfd_vma sym_low_pc, sym_high_pc;
  bfd_vma overlap, addr;
  unsigned int bin_count;
  unsigned int i;
  double count_time, credit;

  bfd_vma lowpc = r->lowpc / sizeof (UNIT);

  /* Iterate over all sample bins.  */
  for (i = 0; i < r->num_bins; ++i)
{
unsigned int j;
  bin_count = r->sample[i];
  if (! bin_count)
continue;

  bin_low_pc = lowpc + (bfd_vma) (hist_scale * i);
  bin_high_pc = lowpc + (bfd_vma) (hist_scale * (i + 1));
  count_time = bin_count;

  DBG (SAMPLEDEBUG,
   printf (
  "[assign_samples] bin_low_pc=0x%lx, bin_high_pc=0x%lx, bin_count=%u\n",
(unsigned long) (sizeof (UNIT) * bin_low_pc),
(unsigned long) (sizeof (UNIT) * bin_high_pc),
bin_count));
  total_time += count_time;

  /* Credit all symbols that are covered by bin I.  */
  for (j = 1; j < symtab.len; ++j)
{
  sym_low_pc = symtab.base[j].hist.scaled_addr;
  sym_high_pc = symtab.base[j + 1].hist.scaled_addr;

  /* If high end of bin is below entry address,
 go for next bin.  */
  if (bin_high_pc < sym_low_pc)
  {
  j++;
break;
  }

  /* If low end of bin is above high end of symbol,
 go for next symbol.  */
  if (bin_low_pc >= sym_high_pc)
continue;

  overlap =
MIN (bin_high_pc, sym_high_pc) - MAX (bin_low_pc, sym_low_pc);
  if (overlap > 0)
{
  DBG (SAMPLEDEBUG,
   printf (
   "[assign_samples] [0x%lx,0x%lx) %s gets %f ticks %ld overlap\n",
   (unsigned long) symtab.base[j].addr,
   (unsigned long) (sizeof (UNIT) * sym_high_pc),
   symtab.base[j].name, overlap * count_time / hist_scale,
   (long) overlap));

  addr = symtab.base[j].addr;
  credit = overlap * count_time / hist_scale;

  /* Credit symbol if it appears in INCL_FLAT or that
 table is empty and it does not appear it in
 EXCL_FLAT.  */
  if (sym_lookup (&syms[INCL_FLAT], addr)
  || (syms[INCL_FLAT].len == 0
  && !sym_lookup (&syms[EXCL_FLAT], addr)))
{
  symtab.base[j].hist.time += credit;
}
  else
{
  total_time -= credit;
}
}
}
}

  DBG (SAMPLEDEBUG, printf ("[assign_samples] total_time %f\n",
total_time));
}

-- 
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