* objcopy.c (copy_object): Set SEC_LINKER_CREATED when adding
authorNathan Sidwell <nathan@codesourcery.com>
Mon, 1 Feb 2010 09:59:46 +0000 (09:59 +0000)
committerNathan Sidwell <nathan@codesourcery.com>
Mon, 1 Feb 2010 09:59:46 +0000 (09:59 +0000)
sections.

testsuite/
* binutils-all/note-1.d: New.
* binutils-all/objcopy.exp: Add it.

binutils/ChangeLog
binutils/objcopy.c
binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/note-1.d [new file with mode: 0644]
binutils/testsuite/binutils-all/objcopy.exp

index fab15bbffbf72ded8ff639a47d1569dd8b781382..719192b5ff2f271ff2f3657b12e1d2ddc4fa4aa7 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-01  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * objcopy.c (copy_object): Set SEC_LINKER_CREATED when adding
+       sections.
+
 2010-01-28  Nick Clifton  <nickc@redhat.com>
 
        PR 11225
index 5df1449dbf504da278fb3135377af899575f47aa..a9b0d3717d804c1d231eccba250c109b623bbfd2 100644 (file)
@@ -1608,7 +1608,12 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
            }
          else
            {
-             padd->section = bfd_make_section_with_flags (obfd, padd->name, flags);
+             /* We use LINKER_CREATED here so that the backend hooks
+                will create any special section type information,
+                instead of presuming we know what we're doing merely
+                because we set the flags.  */
+             padd->section = bfd_make_section_with_flags
+               (obfd, padd->name, flags | SEC_LINKER_CREATED);
              if (padd->section == NULL)
                {
                  bfd_nonfatal_message (NULL, obfd, NULL,
index 38cc467006c32402f862c98d372642821dee1a62..e9c6bc0cd19175551477aa3b3277faf7ed027102 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-01  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * binutils-all/note-1.d: New.
+       * binutils-all/objcopy.exp: Add it.
+
 2010-01-30  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        * binutils-all/windres/html.rc: Don't xfail x86_64-*-mingw*.
diff --git a/binutils/testsuite/binutils-all/note-1.d b/binutils/testsuite/binutils-all/note-1.d
new file mode 100644 (file)
index 0000000..1a42949
--- /dev/null
@@ -0,0 +1,12 @@
+#PROG: objcopy
+#readelf: -S --wide
+#objcopy: --add-section .note=$srcdir/note-1.d
+#name: add notes section
+#source: copytest.s
+
+There are .*
+
+Section Headers:
+#...
+  \[[ 0-9]*\] .note             NOTE            0*0000000 0*...... 0*000... .*
+#...
index f7f6cde338963cf7e93f39ac137351bdacdd5a61..f734e14836e41be341c3f3cd00aa5ec92468a8ac 100644 (file)
@@ -835,6 +835,7 @@ if [is_elf_format] {
     objcopy_test_readelf "ELF group" group-3.s
     objcopy_test_readelf "ELF group" group-4.s
     run_dump_test "copy-1"
+    run_dump_test "note-1"
 }
 
 run_dump_test "copy-2"
This page took 0.043779 seconds and 4 git commands to generate.