[Bug gold/20996] New: build error with -O3

2016-12-28 Thread markus at trippelsdorf dot de
https://sourceware.org/bugzilla/show_bug.cgi?id=20996

Bug ID: 20996
   Summary: build error with -O3
   Product: binutils
   Version: 2.29 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: markus at trippelsdorf dot de
CC: ian at airs dot com
  Target Milestone: ---

gold doesn't build with gcc-trunk and -O3:

...
x86_64-pc-linux-gnu-g++ -W -Wall-Wstack-usage=262144 -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -frandom-seed=dwp  -flifetime-dse=1 -fnull-this-pointer
-DBOOST_ERROR_CODE_HEAD
ER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -march=amdfam10 -O3 -pipe 
-Wl,--no-demangle,--hash-style=gnu,--as-needed,--gc-sections,--icf=safe -o dwp
dwp.o libgold.a ../libiberty/libiber
ty.a   -lpthread -ldl -lz -ldl  
dwp.o:dwp.cc:function _ZN4gold16Sized_relobj_dwoILi32ELb1EE5setupEv: error:
undefined reference to
'_ZN4gold28build_compressed_section_mapILi32ELb1EEEPSt3mapIjNS_23Compressed_sect
ion_infoESt4lessIjESaISt4pairIKjS2_EEEPKhjPKcmPNS_6ObjectEb'
dwp.o:dwp.cc:function _ZN4gold16Sized_relobj_dwoILi32ELb0EE5setupEv: error:
undefined reference to
'_ZN4gold28build_compressed_section_mapILi32ELb0EEEPSt3mapIjNS_23Compressed_sect
ion_infoESt4lessIjESaISt4pairIKjS2_EEEPKhjPKcmPNS_6ObjectEb'
dwp.o:dwp.cc:function _ZN4gold16Sized_relobj_dwoILi64ELb1EE5setupEv: error:
undefined reference to
'_ZN4gold28build_compressed_section_mapILi64ELb1EEEPSt3mapIjNS_23Compressed_sect
ion_infoESt4lessIjESaISt4pairIKjS2_EEEPKhjPKcmPNS_6ObjectEb'
dwp.o:dwp.cc:function _ZN4gold16Sized_relobj_dwoILi64ELb0EE5setupEv: error:
undefined reference to
'_ZN4gold28build_compressed_section_mapILi64ELb0EEEPSt3mapIjNS_23Compressed_sect
ion_infoESt4lessIjESaISt4pairIKjS2_EEEPKhjPKcmPNS_6ObjectEb'
collect2: error: ld returned 1 exit status  

It looks like the template function Compressed_section_map*
build_compressed_section_map() needs to be explicitly instantiated in
object.cc.
Otherwise it will get optimized away.

-- 
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/20995] Read-only data in ELF libraries may be remapped writable at runtime

2016-12-28 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20995

--- Comment #5 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

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

commit 9acc85a62eb76c270724bba15c889d2d05567b6a
Author: Alan Modra 
Date:   Wed Dec 28 17:04:15 2016 +1030

Use dynrelro for symbols in relro sections too

PR ld/20995
bfd/
* elflink.c (elf_link_add_object_symbols): Mark relro sections
in dynamic objects SEC_READONLY.
ld/
* testsuite/ld-elf/pr20995c.s: New test file.
* testsuite/ld-elf/pr20995-2so.r: Likewise.
* testsuite/ld-elf/elf.exp: Run it.

-- 
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/20996] build error with -O3

2016-12-28 Thread markus at trippelsdorf dot de
https://sourceware.org/bugzilla/show_bug.cgi?id=20996

--- Comment #1 from Markus Trippelsdorf  ---
This patch seems to work:

diff --git a/gold/object.cc b/gold/object.cc
index 72afc4557d4a..768d42c2692c 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -3457,4 +3457,44 @@ Xindex::read_symtab_xindex<64, true>(Object*, unsigned
int,
 const unsigned char*);
 #endif

+template
+Compressed_section_map*
+build_compressed_section_map <32, false>(
+const unsigned char* pshdrs,
+unsigned int shnum,
+const char* names,
+section_size_type names_size,
+Object* obj,
+bool decompress_if_needed);
+
+template
+Compressed_section_map*
+build_compressed_section_map <64, false>(
+const unsigned char* pshdrs,
+unsigned int shnum,
+const char* names,
+section_size_type names_size,
+Object* obj,
+bool decompress_if_needed);
+
+template
+Compressed_section_map*
+build_compressed_section_map <32, true>(
+const unsigned char* pshdrs,
+unsigned int shnum,
+const char* names,
+section_size_type names_size,
+Object* obj,
+bool decompress_if_needed);
+
+template
+Compressed_section_map*
+build_compressed_section_map <64, true>(
+const unsigned char* pshdrs,
+unsigned int shnum,
+const char* names,
+section_size_type names_size,
+Object* obj,
+bool decompress_if_needed);
+
 } // End namespace gold.

-- 
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/20995] Read-only data in ELF libraries may be remapped writable at runtime

2016-12-28 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20995

--- Comment #6 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_28-branch branch has been updated by Alan Modra
:

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

commit b9f351d14e9862d3521c24820671e6531d604364
Author: Alan Modra 
Date:   Wed Dec 28 17:04:15 2016 +1030

Use dynrelro for symbols in relro sections too

PR ld/20995
bfd/
* elflink.c (elf_link_add_object_symbols): Mark relro sections
in dynamic objects SEC_READONLY.
ld/
* testsuite/ld-elf/pr20995c.s: New test file.
* testsuite/ld-elf/pr20995-2so.r: Likewise.
* testsuite/ld-elf/elf.exp: Run it.

-- 
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/20996] build error with -O3

2016-12-28 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20996

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_28-branch branch has been updated by Cary Coutant
:

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

commit 9f34aa82a47f1c88543ff9690c0d1ebd3446803b
Author: Cary Coutant 
Date:   Wed Dec 28 08:29:43 2016 -0800

Add explicit instantiations for build_compressed_section_map().

gold/
PR gold/20996
* object.cc (build_compressed_section_map): Add explicit
instantiations.

-- 
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/20996] build error with -O3

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

Cary Coutant  changed:

   What|Removed |Added

Version|2.29 (HEAD) |2.28

-- 
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/20996] build error with -O3

2016-12-28 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20996

--- Comment #2 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Cary Coutant :

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

commit 265d97f743a4ba78bcffd7ae8d0ea02668a58df3
Author: Cary Coutant 
Date:   Wed Dec 28 08:29:43 2016 -0800

Add explicit instantiations for build_compressed_section_map().

gold/
PR gold/20996
* object.cc (build_compressed_section_map): Add explicit
instantiations.

-- 
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/20996] build error with -O3

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

Cary Coutant  changed:

   What|Removed |Added

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

--- Comment #4 from Cary Coutant  ---
Need appropriate ifdefs around each instantiation.

Fixed on trunk and binutils-2_28-branch.

-- 
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/21000] New: hppa-linux does not support -z relro

2016-12-28 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21000

Bug ID: 21000
   Summary: hppa-linux does not support -z relro
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: amodra at gmail dot com
  Target Milestone: ---

The fix for pr12376 results in no -z relro support for hppa-linux.  You can't
force DATA_ADDR and have relro support.

-- 
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/21000] hppa-linux does not support -z relro

2016-12-28 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21000

Alan Modra  changed:

   What|Removed |Added

 Target||hppa-linux
 CC||danglin at gcc dot gnu.org

-- 
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/12376] File offsets for PT_LOAD segments and resulting inequivalent memory aliases

2016-12-28 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=12376

Alan Modra  changed:

   What|Removed |Added

 Target||hppa-linux

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