This is the mail archive of the binutils@sources.redhat.com 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]

Tweak (suppressed) .note.gnu.arm.ident


I had a need for binary tagging, probably for the same reasons Nick
originally added this code, so I've been enabling the #if 0's locally.
Some small problems I noticed:

  - For COFF, the note section is marked alloc/load.  I presume this is
because it is named .note and there can only be one .note section.  For ELF,
the flags were never set; the default of flags == 0 implies !SEC_READONLY.

  - The section was placed between the text and data segments, rather than
at the end with other non-loadable segments, and its address was not
cleared.

Is this OK?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-01-30  Daniel Jacobowitz  <drow@mvista.com>

	* emulparams/armelf.sh, emulparams/armelf_linux.sh: Move
	.note.gnu.arm.ident to after allocated sections.  Mark its
	address as 0.

2004-01-30  Daniel Jacobowitz  <drow@mvista.com>

	* config/tc-arm.c (md_begin): Mark .note.gnu.arm.ident as
	read-only.

Index: src/ld/emulparams/armelf.sh
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/ld/emulparams/armelf.sh,v
retrieving revision 1.11
diff -u -p -r1.11 armelf.sh
--- src/ld/emulparams/armelf.sh	9 Oct 2003 14:06:07 -0000	1.11
+++ src/ld/emulparams/armelf.sh	29 Jan 2004 23:31:48 -0000
@@ -7,9 +7,9 @@ TEXT_START_ADDR=0x8000
 TEMPLATE_NAME=elf32
 EXTRA_EM_FILE=armelf
 OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
-OTHER_READONLY_SECTIONS='.note.gnu.arm.ident : { KEEP (*(.note.gnu.arm.ident)) }'
 OTHER_BSS_SYMBOLS='__bss_start__ = .;'
 OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
 
 DATA_START_SYMBOLS='__data_start = . ;';
 
Index: src/ld/emulparams/armelf_linux.sh
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/ld/emulparams/armelf_linux.sh,v
retrieving revision 1.9
diff -u -p -r1.9 armelf_linux.sh
--- src/ld/emulparams/armelf_linux.sh	9 Oct 2003 14:06:07 -0000	1.9
+++ src/ld/emulparams/armelf_linux.sh	29 Jan 2004 23:31:49 -0000
@@ -10,9 +10,9 @@ GENERATE_SHLIB_SCRIPT=yes
 
 DATA_START_SYMBOLS='__data_start = . ;';
 OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
-OTHER_READONLY_SECTIONS='.note.gnu.arm.ident : { KEEP (*(.note.gnu.arm.ident)) }'
 OTHER_BSS_SYMBOLS='__bss_start__ = .;'
 OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
 
 TEXT_START_ADDR=0x00008000
 
Index: src/gas/config/tc-arm.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gas/config/tc-arm.c,v
retrieving revision 1.161
diff -u -p -r1.161 tc-arm.c
--- src/gas/config/tc-arm.c	23 Jan 2004 16:29:34 -0000	1.161
+++ src/gas/config/tc-arm.c	29 Jan 2004 23:09:36 -0000
@@ -11809,6 +11809,9 @@ md_begin ()
     bfd_set_section_flags (stdoutput, arm_arch,
 			   SEC_DATA | SEC_ALLOC | SEC_LOAD | SEC_LINK_ONCE \
 			   | SEC_HAS_CONTENTS);
+#else
+    bfd_set_section_flags (stdoutput, arm_arch,
+			   SEC_READONLY | SEC_HAS_CONTENTS);
 #endif
     arm_arch->output_section = arm_arch;
     subseg_set (arm_arch, 0);


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