Re: [Bug gas/1568] New: COFF code section should be read only
Hi Vahur, To create object files which are link-compatible with MS Visual C, the "x" flag in .section directive should also set read only flag in COFF section. Otherwise MS linker will complain about multiple segments with different attributes and in fact will not merge such section with other code sections. I tracked down the problem to the function obj_coff_section in file config/obj- coff.c where line case 'x': flags |= SEC_CODE | SEC_LOAD; break; should be changed to case 'x': flags |= SEC_CODE | SEC_LOAD | SEC_READONLY; break; Read/write code sections are possible then by specifying "wx" as section attributes. Except that the "w" flag will be processed first, clearing the readonly bit and then the "x" flag will be processed, setting it. In order to obtain read/write code sections you would need to use "xw" as the flags. I agree that it makes sense to have code sections marked as readonly be default, but I am worried that making this change would break other tools which rely upon the current behaviour. Still if we make the "w" flag behave as you originally suggested it might be OK. Please could you try out the uploaded patch and see if it resolves the problem for you ? Cheers Nick gas/ChangeLog 2005-10-28 Nick Clifton <[EMAIL PROTECTED]> PR binutils/1568 * config/obj-coff.c (obj_coff_section): Set readonly flag with the 'x' attribute. Remember the actions of the 'w' and 'n' attributes and do not allow the 'x','s' or 'd' attributes to change them. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gas/1568] COFF code section should be read only
--- Additional Comments From nickc at redhat dot com 2005-10-28 10:34 --- Subject: Re: New: COFF code section should be read only Hi Vahur, > To create object files which are link-compatible with MS Visual C, the "x" > flag > in .section directive should also set read only flag in COFF section. > Otherwise > MS linker will complain about multiple segments with different attributes and > in fact will not merge such section with other code sections. > I tracked down the problem to the function obj_coff_section in file > config/obj- > coff.c where line > case 'x': flags |= SEC_CODE | SEC_LOAD; break; > should be changed to > case 'x': flags |= SEC_CODE | SEC_LOAD | SEC_READONLY; break; > > Read/write code sections are possible then by specifying "wx" as section > attributes. Except that the "w" flag will be processed first, clearing the readonly bit and then the "x" flag will be processed, setting it. In order to obtain read/write code sections you would need to use "xw" as the flags. I agree that it makes sense to have code sections marked as readonly be default, but I am worried that making this change would break other tools which rely upon the current behaviour. Still if we make the "w" flag behave as you originally suggested it might be OK. Please could you try out the uploaded patch and see if it resolves the problem for you ? Cheers Nick gas/ChangeLog 2005-10-28 Nick Clifton <[EMAIL PROTECTED]> PR binutils/1568 * config/obj-coff.c (obj_coff_section): Set readonly flag with the 'x' attribute. Remember the actions of the 'w' and 'n' attributes and do not allow the 'x','s' or 'd' attributes to change them. -- http://sourceware.org/bugzilla/show_bug.cgi?id=1568 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gas/1568] COFF code section should be read only
--- Additional Comments From nickc at redhat dot com 2005-10-28 10:36 --- Created an attachment (id=730) --> (http://sourceware.org/bugzilla/attachment.cgi?id=730&action=view) set readonly bit when handling 'x' attribute for COFF .section pseudo op -- http://sourceware.org/bugzilla/show_bug.cgi?id=1568 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gas/1568] COFF code section should be read only
-- What|Removed |Added Status|NEW |WAITING http://sourceware.org/bugzilla/show_bug.cgi?id=1568 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/1543] LD very slow especially when linking C++ object files on alpha
--- Additional Comments From hjl at lucon dot org 2005-10-28 15:32 --- I also need /lib/libc.so.6.1 and /usr/lib/libc_nonshared.a. -- http://sourceware.org/bugzilla/show_bug.cgi?id=1543 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/1543] LD very slow especially when linking C++ object files on alpha
--- Additional Comments From alenhar2 at cs dot uiuc dot edu 2005-10-28 16:11 --- Updated again. -- http://sourceware.org/bugzilla/show_bug.cgi?id=1543 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/1543] LD very slow especially when linking C++ object files on alpha
--- Additional Comments From hjl at lucon dot org 2005-10-28 17:00 --- I also need ld-linux.so.2. -- http://sourceware.org/bugzilla/show_bug.cgi?id=1543 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/1472] Sparc a.out using binutils -
--- Additional Comments From hjl at lucon dot org 2005-10-28 17:05 --- I checked in my patch. I think objcopy should work now as long as you don't create those sections which a.out doesn't support. -- What|Removed |Added Status|WAITING |RESOLVED Resolution||FIXED http://sourceware.org/bugzilla/show_bug.cgi?id=1472 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/1543] LD very slow especially when linking C++ object files on alpha
--- Additional Comments From alenhar2 at cs dot uiuc dot edu 2005-10-28 17:10 --- updated. -- http://sourceware.org/bugzilla/show_bug.cgi?id=1543 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/1543] LD very slow especially when linking C++ object files on alpha
--- Additional Comments From hjl at lucon dot org 2005-10-28 22:04 --- The slowdown is caused by http://sourceware.org/ml/binutils/2005-05/msg00736.html elf64_alpha_size_rela_got_1 is called many many many times. -- What|Removed |Added CC||rth at redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=1543 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils