This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: current binutils trunk failures on cygwin


Hi H.J.

FAIL: copy with seting section flags 2

objcopy --set-section-flags .text=alloc,data


doesn't work on COFF. Someone needs to fix it or I can make it ELF
only.

It does work with COFF targets (eg alpha-linuxecoff). The problem is PE based targets where there is code to ensure that certain named sections (eg .text) are given specific section flags. This is in order to comply with the PE spec, so really this is not a bug, but a feature.


So I am going to apply the attached patch to resolve this problem by changing the name of the section involved from .text to foo. Actually it does not resolve the problem for AOUT based targets since they do not support arbitrarily named sections, so the test is just marked as unsupported for them. But I think that skipping AOUT targets is better than skipping PE targets.

Cheers
  Nick

binutils/testsuite/ChangeLog
2006-05-02  Nick Clifton  <nickc@redhat.com>

	* binutils-all/copy-2.d: Change the name of the section whose
	flags are changed to "foo" so that the test will work with PE
	based targets.  Skip this test for AOUT based targeted.
	* binutils-all/copytest.s: New file.

Index: binutils/testsuite/binutils-all/copy-2.d
===================================================================
RCS file: /cvs/src/src/binutils/testsuite/binutils-all/copy-2.d,v
retrieving revision 1.1
diff -c -3 -p -r1.1 copy-2.d
*** binutils/testsuite/binutils-all/copy-2.d	26 Apr 2006 13:37:05 -0000	1.1
--- binutils/testsuite/binutils-all/copy-2.d	2 May 2006 12:12:55 -0000
***************
*** 1,14 ****
  #PROG: objcopy
  #objdump: -h
! #objcopy: --set-section-flags .text=alloc,data
  #name: copy with seting section flags 2
! #source: bintest.s
  
  .*: +file format .*
  
  Sections:
  Idx.*
  #...
!   [0-9]* .text.*
!                   CONTENTS, ALLOC, LOAD, RELOC, DATA
  #...
--- 1,18 ----
  #PROG: objcopy
  #objdump: -h
! #objcopy: --set-section-flags foo=contents,alloc,load,code
  #name: copy with seting section flags 2
! #source: copytest.s
! #not-target: *-*-aout
! # Note - we use copytest.s and a section named "foo" rather
! # than .text because for some file formats (eg PE) the .text
! # section has a fixed set of flags and these cannot be changed.
  
  .*: +file format .*
  
  Sections:
  Idx.*
  #...
!   [0-9]* foo.*
!                   CONTENTS, ALLOC, LOAD, CODE
  #...
*** /dev/null	2006-05-02 09:00:29.883801480 +0100
--- binutils/testsuite/binutils-all/copytest.s	2006-05-02 12:47:30.000000000 +0100
***************
*** 0 ****
--- 1,7 ----
+ 	.globl foo_symbol
+ 	.section foo
+ foo_symbol:	
+ 	.long	1
+ 	.section bar
+ bar_symbol:
+ 	.long	2

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]