[Bug ld/19803] gc-sections breaks PE DLL variable export

2016-03-12 Thread martin.koegler at chello dot at
https://sourceware.org/bugzilla/show_bug.cgi?id=19803

--- Comment #2 from martin.koegler at chello dot at ---
The bug is caused by deleting sections and still exporting their symbols with
bogus values:

dx.s:
=
.text
.globl  DllMainCRTStartup
DllMainCRTStartup:
movl$1, %eax
ret
.globl  testval
.section .rdata,"dr"
testval:
.long   1
.long   2

x86_64-w64-mingw32-as  -o dx.o  dx.s
x86_64-w64-mingw32-ld -o dx.dll -shared dx.o  --print-gc-sections  --out-implib
 dx.dll.a --gc-sections

-- 
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/19793] script-sections.cc:1475: possible redundant string copy ?

2016-03-12 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19793

--- Comment #3 from dcb  ---
>There are a few other places in gold where we should also pass by const 
>>reference instead of value for std::string.

$ fgrep "src/gold" cppcheck.20160308.out | fgrep "(performance)"
[src/gold/archive.cc:506]: (performance) Function parameter 'p' should be
passed by reference.
[src/gold/archive.cc:510]: (performance) Function parameter 'p' should be
passed by reference.
[src/gold/gc.h:203]: (performance) Passing the result of c_str() to a function
that takes std::string as argument no. 1 is slow and redundant.
[src/gold/script-sections.cc:1475]: (performance) Function parameter 'name'
should be passed by reference.
$

-- 
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/19793] script-sections.cc:1475: possible redundant string copy ?

2016-03-12 Thread ccoutant at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19793

Cary Coutant  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|WONTFIX |---

--- Comment #2 from Cary Coutant  ---
Upon further reflection, I've decided that the suggested change is good.

(1) Inlining doesn't make any difference at all. (Not sure what I was thinking
when I wrote that.)

(2) The "if you're going to copy it, pass it by value and let the compiler make
the copy" rule only applies if the function is making a local copy to modify.
That's not the case here -- we're simply assigning it to a data member.

(3) The third reason is still valid -- because we're passing a temporary at the
point of call, there really are no extra copies made and the code is basically
identical as if we had passed by const reference. But passing by const
reference is no worse in this case, and will be better if we ever modify the
code at the point of call such that the argument passed is no longer a
temporary.

There are a few other places in gold where we should also pass by const
reference instead of value for std::string.

-- 
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/19815] New: build incremental-dump only on "make check"

2016-03-12 Thread dilyan.palauzov at aegee dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=19815

Bug ID: 19815
   Summary: build incremental-dump only on "make check"
   Product: binutils
   Version: 2.27 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: dilyan.palauzov at aegee dot org
CC: ian at airs dot com
  Target Milestone: ---

Please alter gold/Makefile.am as follows:

change "noinst_PROGRAMS = ld-net incremental-dump" to "
  noinst_PROGRAMS = ld-new
  check_PROGRAMS = incremental-dump
", so that incremental-dump is built only on "make check".  check_* stuff does
not get installed.

change "SUBDIRS = po testsuite" => "SUBDIRS = . po testsuite" to ensure, that
when doing "make check" the files in the gold/ directory are build before
switching to the testsuite directory (which requires built
../incremental-dump).

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