Browse code

binutils: version update to 2.29

Change-Id: If863c258102f20f2a0b49fda750b7954001902f2
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3424
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

Alexey Makhalov authored on 2017/08/05 09:22:05
Showing 7 changed files
1 1
deleted file mode 100644
... ...
@@ -1,87 +0,0 @@
1
-Submitted By:            DJ Lucas <dj@linuxfromscratch.org>
2
-Date:                    2016-01-08
3
-Initial Package Version: 2.25.1
4
-Upstream Status:         Applied
5
-Origin:                  Upstream
6
-Description: Fix --dynamic-list so that symbols not in the list are
7
-still exported. See https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=e9c1bdad269c0c3352eebcc9481ed65144001b0b;hp=0ed4b0bf3d2ca248778a2ffbcb2c5cafbfdd64dc
8
-
9
-
10
-diff --git a/gold/layout.cc b/gold/layout.cc
11
-index bcdaac8..7836640 100644
12
-+++ b/gold/layout.cc
13
-@@ -4873,7 +4873,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
14
-     flags |= elfcpp::DF_STATIC_TLS;
15
-   if (parameters->options().origin())
16
-     flags |= elfcpp::DF_ORIGIN;
17
--  if (parameters->options().Bsymbolic())
18
-+  if (parameters->options().Bsymbolic()
19
-+      && !parameters->options().have_dynamic_list())
20
-     {
21
-       flags |= elfcpp::DF_SYMBOLIC;
22
-       // Add DT_SYMBOLIC for compatibility with older loaders.
23
-diff --git a/gold/options.cc b/gold/options.cc
24
-index 7eb8f27..7f1f69e 100644
25
-+++ b/gold/options.cc
26
-@@ -1200,13 +1200,6 @@ General_options::finalize()
27
-   // in the path, as appropriate.
28
-   this->add_sysroot();
29
- 
30
--  // --dynamic-list overrides -Bsymbolic and -Bsymbolic-functions.
31
--  if (this->have_dynamic_list())
32
--    {
33
--      this->set_Bsymbolic(false);
34
--      this->set_Bsymbolic_functions(false);
35
--    }
36
--
37
-   // Now that we've normalized the options, check for contradictory ones.
38
-   if (this->shared() && this->is_static())
39
-     gold_fatal(_("-shared and -static are incompatible"));
40
-diff --git a/gold/symtab.h b/gold/symtab.h
41
-index aa0cb68..9413360 100644
42
-+++ b/gold/symtab.h
43
-@@ -604,10 +604,8 @@ class Symbol
44
-     if (parameters->options().in_dynamic_list(this->name()))
45
-       return true;
46
- 
47
--    // If the user used -Bsymbolic or provided a --dynamic-list script,
48
--    // then nothing (else) is preemptible.
49
--    if (parameters->options().Bsymbolic()
50
--        || parameters->options().have_dynamic_list())
51
-+    // If the user used -Bsymbolic, then nothing (else) is preemptible.
52
-+    if (parameters->options().Bsymbolic())
53
-       return false;
54
- 
55
-     // If the user used -Bsymbolic-functions, then functions are not
56
-diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
57
-index f767c21..7b73f9d 100644
58
-+++ b/gold/testsuite/Makefile.am
59
-@@ -1518,7 +1518,7 @@ dynamic_list_lib1.o: dynamic_list_lib1.cc
60
- 	$(CXXCOMPILE) -c -fpic -o $@ $<
61
- 
62
- dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t
63
--	$(CXXLINK) -Bgcctestdir/ -shared -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
64
-+	$(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
65
- dynamic_list_lib2.o: dynamic_list_lib2.cc
66
- 	$(CXXCOMPILE) -c -fpic -o $@ $<
67
- 
68
-diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
69
-index 217e472..b4ae3fd 100644
70
-+++ b/gold/testsuite/Makefile.in
71
-@@ -5319,7 +5319,7 @@ uninstall-am:
72
- @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -c -fpic -o $@ $<
73
- 
74
- @GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t
75
--@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -shared -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
76
-+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
77
- @GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list_lib2.o: dynamic_list_lib2.cc
78
- @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -c -fpic -o $@ $<
79
- 
80
-1.9.4
81
-
82 1
deleted file mode 100644
... ...
@@ -1,98 +0,0 @@
1
-diff -rup binutils-2.25.1/binutils/dwarf.c binutils-2.25.1-new/binutils/dwarf.c
2
-+++ binutils-2.25.1-new/binutils/dwarf.c	2017-04-05 14:46:57.208435514 -0700
3
-@@ -76,7 +76,6 @@ int dwarf_check = 0;
4
-    as a zero-terminated list of section indexes comprising one set of debug
5
-    sections from a .dwo file.  */
6
- 
7
--static int cu_tu_indexes_read = 0;
8
- static unsigned int *shndx_pool = NULL;
9
- static unsigned int shndx_pool_size = 0;
10
- static unsigned int shndx_pool_used = 0;
11
-@@ -99,7 +98,7 @@ static int tu_count = 0;
12
- static struct cu_tu_set *cu_sets = NULL;
13
- static struct cu_tu_set *tu_sets = NULL;
14
- 
15
--static void load_cu_tu_indexes (void *file);
16
-+static bfd_boolean load_cu_tu_indexes (void *);
17
- 
18
- /* Values for do_debug_lines.  */
19
- #define FLAG_DEBUG_LINES_RAW	 1
20
-@@ -2704,7 +2703,7 @@ load_debug_info (void * file)
21
-     return num_debug_info_entries;
22
- 
23
-   /* If this is a DWARF package file, load the CU and TU indexes.  */
24
--  load_cu_tu_indexes (file);
25
-+  (void) load_cu_tu_indexes (file);
26
- 
27
-   if (load_debug_section (info, file)
28
-       && process_debug_info (&debug_displays [info].section, file, abbrev, 1, 0))
29
-@@ -7202,21 +7201,26 @@ process_cu_tu_index (struct dwarf_sectio
30
-    section sets that we can use to associate a .debug_info.dwo section
31
-    with its associated .debug_abbrev.dwo section in a .dwp file.  */
32
- 
33
--static void
34
-+static bfd_boolean
35
- load_cu_tu_indexes (void *file)
36
- {
37
-+  static int cu_tu_indexes_read = -1; /* Tri-state variable.  */
38
-+
39
-   /* If we have already loaded (or tried to load) the CU and TU indexes
40
-      then do not bother to repeat the task.  */
41
--  if (cu_tu_indexes_read)
42
--    return;
43
--
44
--  if (load_debug_section (dwp_cu_index, file))
45
--    process_cu_tu_index (&debug_displays [dwp_cu_index].section, 0);
46
--
47
--  if (load_debug_section (dwp_tu_index, file))
48
--    process_cu_tu_index (&debug_displays [dwp_tu_index].section, 0);
49
--
50
--  cu_tu_indexes_read = 1;
51
-+  if (cu_tu_indexes_read == -1)
52
-+    {
53
-+      cu_tu_indexes_read = TRUE;
54
-+  
55
-+      if (load_debug_section (dwp_cu_index, file))
56
-+       if (! process_cu_tu_index (&debug_displays [dwp_cu_index].section, 0))
57
-+         cu_tu_indexes_read = FALSE;
58
-+
59
-+      if (load_debug_section (dwp_tu_index, file))
60
-+       if (! process_cu_tu_index (&debug_displays [dwp_tu_index].section, 0))
61
-+         cu_tu_indexes_read = FALSE;
62
-+    }
63
-+  return (bfd_boolean) cu_tu_indexes_read;
64
- }
65
- 
66
- /* Find the set of sections that includes section SHNDX.  */
67
-@@ -7226,7 +7230,8 @@ find_cu_tu_set (void *file, unsigned int
68
- {
69
-   unsigned int i;
70
- 
71
--  load_cu_tu_indexes (file);
72
-+  if (! load_cu_tu_indexes (file))
73
-+    return NULL;
74
- 
75
-   /* Find SHNDX in the shndx pool.  */
76
-   for (i = 0; i < shndx_pool_used; i++)
77
-diff -rup binutils-2.25.1/binutils/readelf.c binutils-2.25.1-new/binutils/readelf.c
78
-+++ binutils-2.25.1-new/binutils/readelf.c	2017-04-05 14:38:51.664446483 -0700
79
-@@ -649,8 +649,14 @@ find_section_in_set (const char * name,
80
-   if (set != NULL)
81
-     {
82
-       while ((i = *set++) > 0)
83
--	if (streq (SECTION_NAME (section_headers + i), name))
84
--	  return section_headers + i;
85
-+       {
86
-+         /* See PR 21156 for a reproducer.  */
87
-+         if (i >= elf_header.e_shnum)
88
-+           continue; /* FIXME: Should we issue an error message ?  */
89
-+
90
-+         if (streq (SECTION_NAME (section_headers + i), name))
91
-+           return section_headers + i;
92
-+       }
93
-     }
94
- 
95
-   return find_section (name);
96
-
97 1
deleted file mode 100644
... ...
@@ -1,16 +0,0 @@
1
-+++ b/binutils/objdump.c
2
-@@ -3379,6 +3379,14 @@ dump_relocs_in_section (bfd *abfd,
3
-       return;
4
-     }
5
- 
6
-+  if ((bfd_get_file_flags (abfd) & (BFD_IN_MEMORY | BFD_LINKER_CREATED)) == 0
7
-+      && relsize > get_file_size (bfd_get_filename (abfd)))
8
-+    {
9
-+      printf (" (too many: 0x%x)\n", section->reloc_count);
10
-+      bfd_set_error (bfd_error_file_truncated);
11
-+      bfd_fatal (bfd_get_filename (abfd));
12
-+    }
13
-+
14
-   relpp = (arelent **) xmalloc (relsize);
15
-   relcount = bfd_canonicalize_reloc (abfd, section, relpp, syms);
... ...
@@ -1,16 +1,16 @@
1 1
 Summary:	Contains a linker, an assembler, and other tools
2 2
 Name:		binutils
3
-Version:	2.28
4
-Release:	2%{?dist}
3
+Version:	2.29
4
+Release:	1%{?dist}
5 5
 License:	GPLv2+
6 6
 URL:		http://www.gnu.org/software/binutils
7 7
 Group:		System Environment/Base
8 8
 Vendor:		VMware, Inc.
9 9
 Distribution: 	Photon
10
-Source0:	http://ftp.gnu.org/gnu/binutils/%{name}-%{version}.tar.bz2
11
-%define sha1 binutils=f8b033731f6baa437d429c60e2623570f1ef9d6b
12
-Patch0:         binutils-CVE-2017-6969.patch
13
-Patch1:         binutils-CVE-2017-8421.patch
10
+Source0:	http://ftp.gnu.org/gnu/binutils/%{name}-%{version}.tar.xz
11
+%define sha1 binutils=47817089b3867baf307365004c51677174a27000
12
+Patch0:         check-elf-section-header-only-for-elf-output.patch
13
+Patch1:         elf-checks-for-orphan-placement.patch
14 14
 %description
15 15
 The Binutils package contains a linker, an assembler,
16 16
 and other tools for handling object files.
... ...
@@ -191,18 +191,20 @@ make %{?_smp_mflags} check
191 191
 %{_libdir}/libopcodes.so
192 192
 
193 193
 %changelog
194
-*	Tue May 16 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.28-2
195
--	Patch for CVE-2017-8421
196
-*       Thu Apr 06 2017 Anish Swaminathan <anishs@vmware.com> 2.28-1
197
--       Upgraded to version 2.28
198
--       Apply patch for CVE-2017-6969
199
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.25.1-2
200
--	GA - Bump release of all rpms
201
-*       Tue Jan 12 2016 Xiaolin Li <xiaolinl@vmware.com> 2.25.1-1
202
--       Updated to version 2.25.1
203
-*	Tue Nov 10 2015 Xiaolin Li <xiaolinl@vmware.com> 2.25-2
204
--	Handled locale files with macro find_lang
205
-*	Mon Apr 6 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.25-1
206
--	Updated to 2.25
207
-*	Wed Nov 5 2014 Divya Thaluru <dthaluru@vmware.com> 2.24-1
208
--	Initial build. First version
194
+*   Wed Aug 2 2017 Alexey Makhalov <amakhalov@vmware.com> 2.29-1
195
+-   Version update
196
+*   Tue May 16 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.28-2
197
+-   Patch for CVE-2017-8421
198
+*   Thu Apr 06 2017 Anish Swaminathan <anishs@vmware.com> 2.28-1
199
+-   Upgraded to version 2.28
200
+-   Apply patch for CVE-2017-6969
201
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.25.1-2
202
+-   GA - Bump release of all rpms
203
+*   Tue Jan 12 2016 Xiaolin Li <xiaolinl@vmware.com> 2.25.1-1
204
+-   Updated to version 2.25.1
205
+*   Tue Nov 10 2015 Xiaolin Li <xiaolinl@vmware.com> 2.25-2
206
+-   Handled locale files with macro find_lang
207
+*   Mon Apr 6 2015 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.25-1
208
+-   Updated to 2.25
209
+*   Wed Nov 5 2014 Divya Thaluru <dthaluru@vmware.com> 2.24-1
210
+-   Initial build. First version
209 211
new file mode 100644
... ...
@@ -0,0 +1,85 @@
0
+From db99ecc08f5b66fbe9cb72e90352c7f77ec71a6e Mon Sep 17 00:00:00 2001
1
+From: "H.J. Lu" <hjl.tools@gmail.com>
2
+Date: Wed, 2 Aug 2017 05:10:29 -0700
3
+Subject: [PATCH] Check ELF section header only for ELF output
4
+
5
+When placing an orphan input section, check ELF section header only for
6
+ELF output.
7
+
8
+	PR ld/21884
9
+	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Check
10
+	ELF section header only for ELF output.
11
+	* testsuite/ld-elf/pr21884.d: New test.
12
+	* testsuite/ld-elf/pr21884.t: Likewise.
13
+	* testsuite/ld-elf/pr21884a.s: Likewise.
14
+	* testsuite/ld-elf/pr21884b.s: Likewise.
15
+---
16
+diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
17
+index d2551b6..75ded12 100644
18
+--- a/ld/emultempl/elf32.em
19
+@@ -2136,7 +2136,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
20
+     }
21
+ 
22
+   /* Look through the script to see where to place this section.  */
23
+-  if (constraint == 0)
24
++  if (constraint == 0
25
++      && link_info.output_bfd->xvec->flavour == bfd_target_elf_flavour)
26
+     for (os = lang_output_section_find (secname);
27
+ 	 os != NULL;
28
+ 	 os = next_matching_output_section_statement (os, 0))
29
+diff --git a/ld/testsuite/ld-elf/pr21884.d b/ld/testsuite/ld-elf/pr21884.d
30
+new file mode 100644
31
+index 0000000..52cd2c1
32
+--- /dev/null
33
+@@ -0,0 +1,11 @@
34
++#source: pr21884a.s
35
++#source: pr21884b.s
36
++#ld: -T pr21884.t
37
++#objdump: -b binary -s
38
++#notarget: aarch64*-*-* arm*-*-* nds32*-*-*
39
++# Skip targets which can't change output format to binary.
40
++
41
++.*:     file format binary
42
++
43
++Contents of section .data:
44
++#pass
45
+diff --git a/ld/testsuite/ld-elf/pr21884.t b/ld/testsuite/ld-elf/pr21884.t
46
+new file mode 100644
47
+index 0000000..d483911
48
+--- /dev/null
49
+@@ -0,0 +1,7 @@
50
++OUTPUT_FORMAT("binary")
51
++
52
++ENTRY(_main);
53
++SECTIONS {
54
++	. = 0;
55
++	.setup : { *(.setup) }
56
++}
57
+diff --git a/ld/testsuite/ld-elf/pr21884a.s b/ld/testsuite/ld-elf/pr21884a.s
58
+new file mode 100644
59
+index 0000000..a3361b2
60
+--- /dev/null
61
+@@ -0,0 +1,5 @@
62
++	.text
63
++	.globl	_main
64
++	.type _main,%function
65
++_main:
66
++	.dc.a bar
67
+diff --git a/ld/testsuite/ld-elf/pr21884b.s b/ld/testsuite/ld-elf/pr21884b.s
68
+new file mode 100644
69
+index 0000000..e533837
70
+--- /dev/null
71
+@@ -0,0 +1,5 @@
72
++	.text
73
++	.globl	bar
74
++	.type bar,%function
75
++bar:
76
++	.byte 0
77
+-- 
78
+2.9.3
79
+
0 80
new file mode 100644
... ...
@@ -0,0 +1,157 @@
0
+From 36088682f447540fd8666a2c437fa232064044a7 Mon Sep 17 00:00:00 2001
1
+From: Alan Modra <amodra@gmail.com>
2
+Date: Thu, 3 Aug 2017 14:01:34 +0930
3
+Subject: [PATCH] ELF checks for orphan placement
4
+
5
+The loop checking for previous orphan placement should run even when
6
+the output is non-ELF.
7
+
8
+	PR ld/21884
9
+	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Revert
10
+	last change.  Rename iself to elfinput.  Expand comments.  Condition
11
+	ELF checks on having both input and output ELF files.  Extract..
12
+	(elf_orphan_compatible): ..this new function.
13
+---
14
+diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
15
+index 75ded12..9ac1840 100644
16
+--- a/ld/emultempl/elf32.em
17
+@@ -2008,6 +2008,29 @@ output_rel_find (asection *sec, int isdyn)
18
+   return last;
19
+ }
20
+ 
21
++/* Return whether IN is suitable to be part of OUT.  */
22
++
23
++static bfd_boolean
24
++elf_orphan_compatible (asection *in, asection *out)
25
++{
26
++  /* Non-zero sh_info implies a section with SHF_INFO_LINK with
27
++     unknown semantics for the generic linker, or a SHT_REL/SHT_RELA
28
++     section where sh_info specifies a symbol table.  (We won't see
29
++     SHT_GROUP, SHT_SYMTAB or SHT_DYNSYM sections here.)  We clearly
30
++     can't merge SHT_REL/SHT_RELA using differing symbol tables, and
31
++     shouldn't merge sections with differing unknown semantics.  */
32
++  if (elf_section_data (out)->this_hdr.sh_info
33
++      != elf_section_data (in)->this_hdr.sh_info)
34
++    return FALSE;
35
++  /* We can't merge two sections with differing SHF_EXCLUDE when doing
36
++     a relocatable link.  */
37
++  if (bfd_link_relocatable (&link_info)
38
++      && ((elf_section_flags (out) ^ elf_section_flags (in)) & SHF_EXCLUDE) != 0)
39
++    return FALSE;
40
++  return _bfd_elf_match_sections_by_type (link_info.output_bfd, out,
41
++					  in->owner, in);
42
++}
43
++
44
+ /* Place an orphan section.  We use this to put random SHF_ALLOC
45
+    sections in the right segment.  */
46
+ 
47
+@@ -2064,8 +2087,9 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
48
+   lang_output_section_statement_type *os;
49
+   lang_output_section_statement_type *match_by_name = NULL;
50
+   int isdyn = 0;
51
+-  int iself = s->owner->xvec->flavour == bfd_target_elf_flavour;
52
+-  unsigned int sh_type = iself ? elf_section_type (s) : SHT_NULL;
53
++  int elfinput = s->owner->xvec->flavour == bfd_target_elf_flavour;
54
++  int elfoutput = link_info.output_bfd->xvec->flavour == bfd_target_elf_flavour;
55
++  unsigned int sh_type = elfinput ? elf_section_type (s) : SHT_NULL;
56
+   flagword flags;
57
+   asection *nexts;
58
+ 
59
+@@ -2073,7 +2097,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
60
+       && link_info.combreloc
61
+       && (s->flags & SEC_ALLOC))
62
+     {
63
+-      if (iself)
64
++      if (elfinput)
65
+ 	switch (sh_type)
66
+ 	  {
67
+ 	  case SHT_RELA:
68
+@@ -2095,6 +2119,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
69
+     }
70
+ 
71
+   if (!bfd_link_relocatable (&link_info)
72
++      && elfinput
73
++      && elfoutput
74
+       && (s->flags & SEC_ALLOC) != 0
75
+       && (elf_section_flags (s) & SHF_GNU_MBIND) != 0)
76
+     {
77
+@@ -2135,9 +2161,11 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
78
+ 	secname = ".mbind.text";
79
+     }
80
+ 
81
+-  /* Look through the script to see where to place this section.  */
82
+-  if (constraint == 0
83
+-      && link_info.output_bfd->xvec->flavour == bfd_target_elf_flavour)
84
++  /* Look through the script to see where to place this section.  The
85
++     script includes entries added by previous lang_insert_orphan
86
++     calls, so this loop puts multiple compatible orphans of the same
87
++     name into a single output section.  */
88
++  if (constraint == 0)
89
+     for (os = lang_output_section_find (secname);
90
+ 	 os != NULL;
91
+ 	 os = next_matching_output_section_statement (os, 0))
92
+@@ -2146,29 +2174,19 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
93
+ 	   lang_insert_orphan to create a new output section.  */
94
+ 	constraint = SPECIAL;
95
+ 
96
+-	/* SEC_EXCLUDE is cleared when doing a relocatable link.  But
97
+-	   we can't merge 2 input sections with the same name when only
98
+-	   one of them has SHF_EXCLUDE.  Don't merge 2 sections with
99
+-	   different sh_info.  */
100
++	/* Check to see if we already have an output section statement
101
++	   with this name, and its bfd section has compatible flags.
102
++	   If the section already exists but does not have any flags
103
++	   set, then it has been created by the linker, possibly as a
104
++	   result of a --section-start command line switch.  */
105
+ 	if (os->bfd_section != NULL
106
+-	    && (elf_section_data (os->bfd_section)->this_hdr.sh_info
107
+-		== elf_section_data (s)->this_hdr.sh_info)
108
+ 	    && (os->bfd_section->flags == 0
109
+-		|| ((!bfd_link_relocatable (&link_info)
110
+-		     || (iself && (((elf_section_flags (s)
111
+-				     ^ elf_section_flags (os->bfd_section))
112
+-				    & SHF_EXCLUDE) == 0)))
113
+-		    && ((s->flags ^ os->bfd_section->flags)
114
++		|| (((s->flags ^ os->bfd_section->flags)
115
+ 		     & (SEC_LOAD | SEC_ALLOC)) == 0
116
+-		    && _bfd_elf_match_sections_by_type (link_info.output_bfd,
117
+-							os->bfd_section,
118
+-							s->owner, s))))
119
++		    && (!elfinput
120
++			|| !elfoutput
121
++			|| elf_orphan_compatible (s, os->bfd_section)))))
122
+ 	  {
123
+-	    /* We already have an output section statement with this
124
+-	       name, and its bfd section has compatible flags.
125
+-	       If the section already exists but does not have any flags
126
+-	       set, then it has been created by the linker, probably as a
127
+-	       result of a --section-start command line switch.  */
128
+ 	    lang_add_section (&os->children, s, NULL, os);
129
+ 	    return os;
130
+ 	  }
131
+@@ -2244,8 +2262,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
132
+   else if ((flags & SEC_ALLOC) == 0)
133
+     ;
134
+   else if ((flags & SEC_LOAD) != 0
135
+-	   && ((iself && sh_type == SHT_NOTE)
136
+-	       || (!iself && CONST_STRNEQ (secname, ".note"))))
137
++	   && ((elfinput && sh_type == SHT_NOTE)
138
++	       || (!elfinput && CONST_STRNEQ (secname, ".note"))))
139
+     place = &hold[orphan_interp];
140
+   else if ((flags & (SEC_LOAD | SEC_HAS_CONTENTS | SEC_THREAD_LOCAL)) == 0)
141
+     place = &hold[orphan_bss];
142
+@@ -2255,8 +2273,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
143
+     place = &hold[orphan_tdata];
144
+   else if ((flags & SEC_READONLY) == 0)
145
+     place = &hold[orphan_data];
146
+-  else if (((iself && (sh_type == SHT_RELA || sh_type == SHT_REL))
147
+-	    || (!iself && CONST_STRNEQ (secname, ".rel")))
148
++  else if (((elfinput && (sh_type == SHT_RELA || sh_type == SHT_REL))
149
++	    || (!elfinput && CONST_STRNEQ (secname, ".rel")))
150
+ 	   && (flags & SEC_LOAD) != 0)
151
+     place = &hold[orphan_rel];
152
+   else if ((flags & SEC_CODE) == 0)
153
+-- 
154
+2.9.3
155
+
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	A utility for generating programs that recognize patterns in text
2 2
 Name:		flex
3 3
 Version:	2.6.4
4
-Release:	1%{?dist}
4
+Release:	2%{?dist}
5 5
 License:	BSD
6 6
 URL:		https://github.com/westes/flex/releases
7 7
 Group:		Applications/System
... ...
@@ -28,6 +28,7 @@ flex.
28 28
 %setup -q
29 29
 sed -i -e '/test-bison/d' tests/Makefile.in
30 30
 %build
31
+CFLAGS="-D_GNU_SOURCE" \
31 32
 ./configure \
32 33
 	--prefix=%{_prefix} \
33 34
 	--docdir=%{_defaultdocdir}/%{name}-%{version} \
... ...
@@ -68,19 +69,21 @@ make %{?_smp_mflags} check
68 68
 %{_includedir}/*
69 69
 
70 70
 %changelog
71
-*   Tue May 11 2017 Chang Lee <changlee@vmware.com> 2.6.4-1
71
+*   Fri Aug 4 2017 Alexey Makhalov <amakhalov@vmware.com> 2.6.4-2
72
+-   Use _GNU_SOURCE
73
+*   Thu May 11 2017 Chang Lee <changlee@vmware.com> 2.6.4-1
72 74
 -   Updated to version 2.6.4
73 75
 *   Tue Apr 04 2017 Chang Lee <changlee@vmware.com> 2.6.0-1
74 76
 -   Updated to version 2.6.0
75
-*       Thu Oct 13 2016 Kumar Kaushik <kaushikk@vmware.com> 2.5.39-3
76
--       Fixing Security bug CVE-2016-6354.
77
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.5.39-2
78
--	GA - Bump release of all rpms
79
-* 	Tue Jan 12 2016 Xiaolin Li <xiaolinl@vmware.com> 2.5.39-1
80
-- 	Updated to version 2.5.39
81
-*       Mon Oct 12 2015 Xiaolin Li <xiaolinl@vmware.com> 2.5.38-3
82
--       Moving static lib files to devel package.
83
-*	Fri Jun 5 2015 Divya Thaluru <dthaluru@vmware.com> 2.5.38-2
84
--	Adding m4 package to build and run time required package 
85
-*	Wed Nov 5 2014 Divya Thaluru <dthaluru@vmware.com> 2.5.38-1
86
--	Initial build.	First version
77
+*   Thu Oct 13 2016 Kumar Kaushik <kaushikk@vmware.com> 2.5.39-3
78
+-   Fixing Security bug CVE-2016-6354.
79
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.5.39-2
80
+-   GA - Bump release of all rpms
81
+*   Tue Jan 12 2016 Xiaolin Li <xiaolinl@vmware.com> 2.5.39-1
82
+-   Updated to version 2.5.39
83
+*   Mon Oct 12 2015 Xiaolin Li <xiaolinl@vmware.com> 2.5.38-3
84
+-   Moving static lib files to devel package.
85
+*   Fri Jun 5 2015 Divya Thaluru <dthaluru@vmware.com> 2.5.38-2
86
+-   Adding m4 package to build and run time required package
87
+*   Wed Nov 5 2014 Divya Thaluru <dthaluru@vmware.com> 2.5.38-1
88
+-   Initial build. First version