[Bug binutils/23932] integer overflow causes an endless loop

2020-02-03 Thread green at moxielogic dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23932

Anthony Green  changed:

   What|Removed |Added

 CC||green at moxielogic dot com

--- Comment #3 from Anthony Green  ---
Hey Nick,

  This introduced a regression for me with moxie-elf-objcopy.

  To reproduce, I feed the assembler this:

.section .text
.global _start
_start: 
ldi.l   $r0, 0xab6789ab
sta.l   0x0c0ffee0, $r0
sta.b   0xdead, $r0

  ...like so

$ moxie-elf-as t.s

  And the link it...

$ moxie-elf-ld -o t.x a.out

And then...

$ moxie-elf-objdump -h t.x

t.x: file format elf32-bigmoxie

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 0012  1000  1000  0054  2**0
  CONTENTS, ALLOC, LOAD, READONLY, CODE

But I need to change the LMA to 0 for my processor verilog tests so

$ moxie-elf-objcopy --change-section-lma .text-0x1000 t.x t0.x
moxie-elf-objcopy: t.x: error in private header data: sorry, cannot handle this
file


In this section of elf.c, map->count is 0 in my case...

  /* PR 23932.  A corrupt input file may contain sections that cannot   
 be assigned to any segment - because for example they have a   
 negative size - or segments that do not contain any sections.  */  

  if (map->count == 0)  
{   
sorry:  
  bfd_set_error (bfd_error_sorry);  
  free (sections);  
  return FALSE; 
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/23932] integer overflow causes an endless loop

2020-02-03 Thread green at moxielogic dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23932

--- Comment #4 from Anthony Green  ---
Here's an example of where it is failing: 

https://travis-ci.org/atgreen/moxie-cores/builds/645732440

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/23932] integer overflow causes an endless loop

2020-02-06 Thread green at moxielogic dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23932

--- Comment #6 from Anthony Green  ---
Thanks, Nick.  I've tested this patch and it solves the problem.   Please apply
at your earliest convenience!

-- 
You are receiving this mail because:
You are on the CC list for the bug.