[Bug ld/20995] Read-only data in ELF libraries may be remapped writable at runtime

2017-01-25 Thread jiwang at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20995

Jiong Wang  changed:

   What|Removed |Added

 CC||jiwang at gcc dot gnu.org

--- Comment #12 from Jiong Wang  ---
(In reply to Alan Modra from comment #11)
> I deliberately left the arm FAILs showing.  They are telling you that -z
> relro does not wotk on those target variants.  That should probably be fixed.

Reading the comment at
https://sourceware.org/ml/binutils/2017-01/msg00094.html, I feel we should
define COMMONPAGESIZE for arm-none-eabi, searching src/bfd and src/ld, the only
usage of it is to initialize config.commonpagesize which is later used to
expand "CONSTANT (COMMONPAGESIZE)" when COMMONPAGESIZE is used in linker script
which only play a role when calculating relro_end.

If the runtime doesn't support GNU_RELRO, then I looks to me the user is
responsible to make sure don't pass -z relro to the linker.

-- 
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/21086] New: static linking with --dynamic-list adds dynamic section and interpreter

2017-01-25 Thread nszabolcs at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21086

Bug ID: 21086
   Summary: static linking with --dynamic-list adds dynamic
section and interpreter
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: nszabolcs at gmail dot com
  Target Milestone: ---

i think static linking should work (produce a static
linked executable without any dynamic linker) even
with --dynamic-list, now the produced executable is
broken.

reproducer:

echo 'int main(){}' >a.c
echo '{main;};' >foo.list
gcc -static -Wl,--dynamic-list=foo.list a.c
readelf -l a.out |grep interpreter
  [Requesting program interpreter: /lib/ld64.so.1]

(this is on x86_64, but other targets have the same behaviour)

introduced in

https://sourceware.org/ml/binutils/2016-02/msg00251.html

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

-- 
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/21086] static linking with --dynamic-list adds dynamic section and interpreter

2017-01-25 Thread nszabolcs at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21086

--- Comment #1 from Szabolcs Nagy  ---
also discussed at
https://sourceware.org/ml/binutils/2017-01/msg00429.html

-- 
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/21086] static linking with --dynamic-list adds dynamic section and interpreter

2017-01-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21086

H.J. Lu  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #2 from H.J. Lu  ---
Since you asked to put "main" in dynamic symbol table, linker does
what you requested.  If you don't want to put "main" in dynamic symbol
table, you shouldn't use -Wl,--dynamic-list=foo.list.

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

2017-01-25 Thread jiwang at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20995

--- Comment #13 from Jiong Wang  ---
(In reply to Jiong Wang from comment #12)
> (In reply to Alan Modra from comment #11)
> > I deliberately left the arm FAILs showing.  They are telling you that -z
> > relro does not wotk on those target variants.  That should probably be 
> > fixed.
> 
> Reading the comment at
> https://sourceware.org/ml/binutils/2017-01/msg00094.html, I feel we should
> define COMMONPAGESIZE for arm-none-eabi, searching src/bfd and src/ld, the
> only usage of it is to initialize config.commonpagesize which is later used
> to expand "CONSTANT (COMMONPAGESIZE)" when COMMONPAGESIZE is used in linker
> script which only play a role when calculating relro_end.
> 
> If the runtime doesn't support GNU_RELRO, then I looks to me the user is
> responsible to make sure don't pass -z relro to the linker.

Hmm, but my testing shows define this will waste disk and mem size as there
will be ". = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT
(COMMONPAGESIZE));" after data segment.

-- 
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/21086] static linking with --dynamic-list adds dynamic section and interpreter

2017-01-25 Thread bugdal at aerifal dot cx
https://sourceware.org/bugzilla/show_bug.cgi?id=21086

Rich Felker  changed:

   What|Removed |Added

 CC||bugdal at aerifal dot cx

--- Comment #3 from Rich Felker  ---
--dynamic-list is not a request to export the symbol in the dynamic symbol
table; -E/-rdynamic does that. --dynamic-list is an exclusion list for
-Bsymbolic that makes everything not in the list get treated as -Bsymbolic.

As for using --dynamic-list, it's gdb (part of the binutils tree) that's using
it in its build process and thus breaking static linking.

-- 
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/21086] static linking with --dynamic-list adds dynamic section and interpreter

2017-01-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21086

--- Comment #4 from H.J. Lu  ---
(In reply to Rich Felker from comment #3)
> --dynamic-list is not a request to export the symbol in the dynamic symbol
> table; -E/-rdynamic does that. --dynamic-list is an exclusion list for
> -Bsymbolic that makes everything not in the list get treated as -Bsymbolic.

-E puts all global symbols in dynamic symbol table and --dynamic-list puts
symbols listed in file in dynamic symbol table.  If no symbols should be
put in dynamic symbol table, --dynamic-list shouldn't be used.

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