[Bug binutils/17765] Bad bit shift operation

2015-03-06 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=17765

--- Comment #4 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=65164438aaf163aee0de40bcfab87dfd58f47b6b

commit 65164438aaf163aee0de40bcfab87dfd58f47b6b
Author: Nick Clifton 
Date:   Fri Mar 6 09:46:15 2015 +

Fix an undefined 32-bit right shift by replacing it with two 16-bit right
shifts.

PR binutils/17765
* elflink.c (put_value): Like previous delta, but for the 32-bit
case.

-- 
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/17765] Bad bit shift operation

2015-03-06 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=17765

--- Comment #5 from Nick Clifton  ---
Hi Sandra,

  Fascinating.  It seems my previous patch has exposed a latent bug.  I have
checked in the obvious fix for the 32-bit case, although worryingly I was
unable to reproduce the failure building on my 64-bit host machine.  Even
though I was building a 32-bit binary.  I guess I may need to create a virtual
machine and install a 32-bit OS on it if I want to reprpduce this kind of bug
in the future.

Cheers
  Nick

-- 
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/18087] objcopy --compress-debug-sections can produce broken debug sections in PE binaries

2015-03-06 Thread ktietz70 at googlemail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18087

Kai Tietz  changed:

   What|Removed |Added

 CC||ktietz70 at googlemail dot com

--- Comment #1 from Kai Tietz  ---
Yes, it is likely that we have here an issue in updating section size, if
compression actually increases, instead of decreasing size.

IMO the saner approach would be to reject compression, if content gets larger
as before

-- 
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/18087] New: objcopy --compress-debug-sections can produce broken debug sections in PE binaries

2015-03-06 Thread jon.turney at dronecode dot org.uk
https://sourceware.org/bugzilla/show_bug.cgi?id=18087

Bug ID: 18087
   Summary: objcopy --compress-debug-sections can produce broken
debug sections in PE binaries
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: jon.turney at dronecode dot org.uk

Created attachment 8177
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8177&action=edit
Update section virtual size when it's compressed or decompressed

PE binary support for objcopy --compress-debug-sections added in bug #14067
(commit a29a8af8) seems to have a problem when compression makes sections
larger.

Examining the unstripped XWin.exe for which the problem was reported [1] (using
my own PE dumper as objdump -h transparently decompresses the compressed
sections for you.)

Section Name  Virtual Size   VMARawSize File Offset  
Characteristics
   .text  0017df74   1000   0017e000   0600   60500060
   .data  4184   0017f000   4200   0017e600   c0700040
  .rdata  000321e0   00184000   00032200   00182800   40700040
.buildid  0035   001b7000   0200   001b4a00   40300040
  /4.eh_frame 00049240   001b8000   00049400   001b4c00   40300040
.bss  eae0   00202000         c0700080
  .edata  0002a0a5   00211000   0002a200   001fe000   40300040
  .idata  4c70   0023c000   4e00   00228200   c0300040
   .rsrc  7800   00241000   7400   0022d000   c0300040
  .reloc  d1bc   00249000   d200   00234800   42300040
 /14   .debug_aranges 2fb0   00257000   3000   00241a00   42400040
 /29  .debug_info 007c423e   0025a000   007c4400   00244a00   42100040
 /41.debug_abbrev 00056487   00a1f000   00056600   00a08e00   42100040
 /55  .debug_line 0009576a   00a76000   00095800   00a5f400   42100040
 /67 .debug_frame 0038   00b0c000   0200   00af4c00   42300040
 /80   .debug_str 00026a8b   00b0d000   00026c00   00af4e00   42100040
 /91   .debug_loc 001799f0   00b34000   00179a00   00b1ba00   42100040
/102.debug_ranges 00038b88   00cae000   00038c00   00c95400   42100040

Compare with this after it's compressed using objcopy
-compressed-debug-sections

Section Name  Virtual Size   VMARawSize File Offset  
Characteristics
   .text  0017df74   1000   0017e000   0600   60500060
   .data  4184   0017f000   4200   0017e600   c0700040
  .rdata  000321e0   00184000   00032200   00182800   40700040
.buildid  0035   001b7000   0200   001b4a00   40300040
  /4.eh_frame 00049240   001b8000   00049400   001b4c00   40300040
.bss  eae0   00202000         c0700080
  .edata  0002a0a5   00211000   0002a200   001fe000   40300040
  .idata  4c70   0023c000   4e00   00228200   c0300040
   .rsrc  7800   00241000   7400   0022d000   c0300040
  .reloc  d1bc   00249000   d200   00234400   42300040
 /14  .zdebug_aranges 2fb0   00257000   1200   00241600   42400040
 /30 .zdebug_info 007c423e   0025a000   00356200   00242800   42100040
 /43   .zdebug_abbrev 00056487   00a1f000   d600   00598a00   42100040
 /58 .zdebug_line 0009576a   00a76000   00040600   005a6000   42100040
 /71.zdebug_frame 0038   00b0c000   0200   005e6600   42300040
 /85  .zdebug_str 00026a8b   00b0d000   5c00   005e6800   42100040
 /97  .zdebug_loc 001799f0   00b34000   0007de00   005ec400   42100040
/109   .zdebug_ranges 00038b88   00cae000   00013000   0066a200   42100040

It can be seen that the virtual size of the compressed sections is not updated,
although the raw size has decreased.

Normally this is not a problem, as nothing is accessing the section contents
after the raw size.

However, if the compressor has made the data bigger, it is truncated to the
virtual size and decompression fails.

Unfortunately, small .debug_frame sections seem to be quite normal on x86.

Attached is a patch which updates the virtual size, which seems to fix this
issue.

Section Name  Virtual Size   VMARawSize File Offset  
Characteristics
   .text  0017df74   1000   0017e000   0600   60500060
   .data  4184   0017f000   4200   0017e600   c0700040
  .rdata  000321e0   00184000   00032200   00182800   40700040
.buildid  0035   001b7000   0200   001b4a00   40300040
  /4.eh_frame 00049240

[Bug binutils/18087] objcopy --compress-debug-sections can produce broken debug sections in PE binaries

2015-03-06 Thread jon.turney at dronecode dot org.uk
https://sourceware.org/bugzilla/show_bug.cgi?id=18087

--- Comment #2 from Jon TURNEY  ---
(In reply to Kai Tietz from comment #1)
> Yes, it is likely that we have here an issue in updating section size, if
> compression actually increases, instead of decreasing size.
> 
> IMO the saner approach would be to reject compression, if content gets
> larger as before

I think my patch is no good because an output PE which is unstripped but has
compressed debug sections is not valid, because it breaks the "sections must
have contiguous VMAs" constraint.

So not compressing if the section gets larger sounds like a better approach. 
I'll have a go at implementing that.

-- 
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/17444] g++ tests g++.dg/ipa/pr61160-2.C and g++.dg/ipa/pr61160-3 fail on arm-none-linux-gnueabi with -mthumb

2015-03-06 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=17444

Nick Clifton  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #3 from Nick Clifton  ---
Hi Sandra,

  Thanks - I can now reproduce the problem.

  Interestingly this turns out to be a gas bug, not a linker bug.

  The problem is that the relocation generated by gas for the call to
...artificial_thunk.1 is wrong.  It has an offset of 0x14 built in to the
relocation when in fact it should be 0.  GAS is doing this because the
...artifical_thunk.1 symbol is a local symbol not a global symbol.  You can see
this for yourself by editing the pr61160-2.s file and adding the line:

  .global _ZThn4_N8CExample9MixinFuncEiPv.artificial_thunk.1

just after the function is declared.  Assembling and linking this version of
the pr61160-2.s file will result in a working binary.

  This is where I am currently stumped.  I do not see why GAS should be
treating a local function symbol any differently from a global function symbol. 

  Unfortunately the weekend is here and I have to drop this for now.  But I
will pick up the case again next week.

Cheers
  Nick

-- 
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/17709] [2.26 Regression] elf/vismain test in glibc failed

2015-03-06 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=17709

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_25-branch branch has been updated by H.J. Lu
:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=031994d25c8c8dc392ceb43abc2dfd9a851bc384

commit 031994d25c8c8dc392ceb43abc2dfd9a851bc384
Author: H.J. Lu 
Date:   Thu Mar 5 06:34:39 2015 -0800

Add extern_protected_data and set it for x86

With copy relocation, address of protected data defined in the shared
library may be external.  This patch adds extern_protected_data and
changes _bfd_elf_symbol_refs_local_p to return false for protected data
if extern_protected_data is true.

Backport from master:

bfd/

PR ld/pr15228
PR ld/pr17709
* elf-bfd.h (elf_backend_data): Add extern_protected_data.
* elf32-i386.c (elf_backend_extern_protected_data): New.
Defined to 1.
* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
copy relocs against protected symbols if extern_protected_data
is true.
(_bfd_elf_symbol_refs_local_p): Don't return true on protected
non-function symbols if extern_protected_data is true.
* elfxx-target.h (elf_backend_extern_protected_data): New.
Default to 0.
(elfNN_bed): Initialize extern_protected_data with
elf_backend_extern_protected_data.

ld/testsuite/

PR ld/pr15228
PR ld/pr17709
* ld-i386/i386.exp (i386tests): Add a test for PR ld/17709.
* ld-i386/pr17709-nacl.rd: New file.
* ld-i386/pr17709.rd: Likewise.
* ld-i386/pr17709a.s: Likewise.
* ld-i386/pr17709b.s: Likewise.
* ld-i386/protected3.d: Updated.
* ld-i386/protected3.s: Likewise.
* ld-x86-64/pr17709-nacl.rd: New file.
* ld-x86-64/pr17709.rd: Likewise.
* ld-x86-64/pr17709a.s: Likewise.
* ld-x86-64/pr17709b.s: Likewise.
* ld-x86-64/protected3.d: Updated.
* ld-x86-64/protected3.s: Likewise.
* ld-x86-64/x86-64.exp (x86_64tests): Add a test for PR ld/17709.

-- 
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/17709] [2.26 Regression] elf/vismain test in glibc failed

2015-03-06 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=17709

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from H.J. Lu  ---
Fixed for 2.26.

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