[Bug binutils/13503] New: [avr] Support RELOCs to represent a byte

2011-12-15 Thread gjl at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13503

 Bug #: 13503
   Summary: [avr] Support RELOCs to represent a byte
   Product: binutils
   Version: 2.23 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassig...@sourceware.org
ReportedBy: g...@gcc.gnu.org
CC: eric.wedding...@atmel.com
Classification: Unclassified
Target: avr


Suppose the following C code from avr-gcc 4.7:

extern const __pgmx char foo;
const __pgmx void * pointer = foo;

Notice that __pgmx is not a macro but a new built-in keyword for a named
address space that can hold 24-bit pointers.

The code from above tries to assembler the address of foo.
However, there is *no* way to do that in binutils because the recprective
RELOCs like hh8 are not allowed in places they are needed:

.globalpointer
.data
.typepointer, @object
.sizepointer, 3
pointer:
.wordfoo
.warningassembling 24-bit address needs binutils extension for
hh8(foo)
.byte0 ;  hh8(foo)

avr-gcc emits a 0 to work around that but the code of not correct as the high
part of the address will always be 0.

-- 
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/13503] [avr] Support RELOCs to represent a byte

2011-12-15 Thread gjl at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13503

Georg-Johann Lay gjl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||bjoern.m.haase at web dot
   ||de

--- Comment #1 from Georg-Johann Lay gjl at gcc dot gnu.org 2011-12-15 
16:19:21 UTC ---
See also respective extensions to avr-gcc:

http://gcc.gnu.org/PR49868
http://gcc.gnu.org/PR50931

-- 
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/13505] New: apply_relocation always use 64bit little endian relocation

2011-12-15 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13505

 Bug #: 13505
   Summary: apply_relocation always use 64bit little endian
relocation
   Product: binutils
   Version: 2.23 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
AssignedTo: i...@airs.com
ReportedBy: hjl.to...@gmail.com
CC: ccout...@google.com
Classification: Unclassified


There are

templateint size, bool big_endian, typename Target_type,
typename Relocate
void
apply_relocation(const Relocate_infosize, big_endian* relinfo,
Target_type* target,
typename elfcpp::Elf_typessize::Elf_Addr r_offset,
unsigned int r_type,
typename elfcpp::Elf_typessize::Elf_Swxword r_addend,
const Symbol* gsym,
unsigned char* view,
typename elfcpp::Elf_typessize::Elf_Addr address,
section_size_type view_size)
{
 // Construct the ELF relocation in a temporary buffer.
 const int reloc_size = elfcpp::Elf_sizes64::rela_size;
 unsigned char relbuf[reloc_size];
 elfcpp::Rela64, false rel(relbuf);
 elfcpp::Rela_write64, false orel(relbuf);
 orel.put_r_offset(r_offset);
 orel.put_r_info(elfcpp::elf_r_info64(0, r_type));
 orel.put_r_addend(r_addend);
...

in target-reloc.h.  It always uses Rela64, false even for 32bit or big
endian target.

-- 
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/13505] apply_relocation always use 64bit little endian relocation

2011-12-15 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13505

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

URL||http://sourceware.org/ml/bi
   ||nutils/2011-12/msg00224.htm
   ||l

--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2011-12-15 19:57:44 
UTC ---
A patch is posted at

http://sourceware.org/ml/binutils/2011-12/msg00224.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 gold/13507] New: Gold assumes GOT entry size is the same as ELF class size

2011-12-15 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13507

 Bug #: 13507
   Summary: Gold assumes GOT entry size is the same as ELF class
size
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
AssignedTo: i...@airs.com
ReportedBy: hjl.to...@gmail.com
CC: ccout...@google.com
Classification: Unclassified


Gold assumes GOT entry size is the same as ELF class size.
But for x32, the got entry size and alignment are 64bit
even though x32 uses 32bit ELF class.

-- 
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/13505] apply_relocation always use 64bit little endian relocation

2011-12-15 Thread cvs-commit at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13505

--- Comment #2 from cvs-commit at gcc dot gnu.org cvs-commit at gcc dot 
gnu.org 2011-12-15 23:29:27 UTC ---
CVSROOT:/cvs/src
Module name:src
Changes by:h...@sourceware.org2011-12-15 23:29:24

Modified files:
gold   : ChangeLog target-reloc.h 

Log message:
Replace 64, false with size, big_endian

2011-12-15  H.J. Lu  hongjiu...@intel.com

PR gold/13505
* target-reloc.h (apply_relocation): Replace 64, false with
size, big_endian.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=srcr1=1.857r2=1.858
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/target-reloc.h.diff?cvsroot=srcr1=1.51r2=1.52

-- 
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/13507] Gold assumes GOT entry size is the same as ELF class size

2011-12-15 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13507

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

URL||http://sourceware.org/ml/bi
   ||nutils/2011-12/msg00229.htm
   ||l

--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2011-12-16 01:05:26 
UTC ---
A patch is posted at

http://sourceware.org/ml/binutils/2011-12/msg00229.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/13509] New: branch target to the wrong location

2011-12-15 Thread pinskia at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13509

 Bug #: 13509
   Summary: branch target to the wrong location
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
AssignedTo: unassig...@sourceware.org
ReportedBy: pins...@gcc.gnu.org
Classification: Unclassified


Take:
.align 2
.global main
.ent main
main:
beqz $5, .L1
nop
addi $5, $5, 1
b .L2
nop

.L1:
#.L3=.
.align 3
.L2:
la $5, .L3
jr  $31
nop
.end main
--- CUT ---
The two branches will take you to L2.
If we uncomment the assignment to .L3, we get something different, where one is
before the .align and the other is after.  This causes in the end causes a
miscompare inside GCC when comparing with and without debugging info.

-- 
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/13505] apply_relocation always use 64bit little endian relocation

2011-12-15 Thread ian at airs dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13505

Ian Lance Taylor ian at airs dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #3 from Ian Lance Taylor ian at airs dot com 2011-12-16 04:53:43 
UTC ---
Fixed.

-- 
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/13509] branch target to the wrong location

2011-12-15 Thread amodra at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13509

Alan Modra amodra at gmail dot com changed:

   What|Removed |Added

 Target||mips-linux
 CC||amodra at gmail dot com

--- Comment #1 from Alan Modra amodra at gmail dot com 2011-12-16 05:16:24 
UTC ---
Seen better if .align 4 or larger alignment is used rather than .align 3

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