This is the mail archive of the binutils-cvs@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]

[binutils-gdb/binutils-2_29-branch] PR21910, segfault in common symbol override test when hash-style=gnu


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ee24a27bb197787eb0935046a8ff1da9df34a502

commit ee24a27bb197787eb0935046a8ff1da9df34a502
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Aug 7 18:02:49 2017 +0930

    PR21910, segfault in common symbol override test when hash-style=gnu
    
    	PR 21910
    	* elflink.c (bfd_elf_final_link): Don't segfault when sections
    	needed to define various dynamic tags have been discarded.

Diff:
---
 bfd/ChangeLog | 6 ++++++
 bfd/elflink.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 37c6665..8ac8332 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-07  Alan Modra  <amodra@gmail.com>
+
+	PR 21910
+	* elflink.c (bfd_elf_final_link): Don't segfault when sections
+	needed to define various dynamic tags have been discarded.
+
 2017-08-05  Alan Modra  <amodra@gmail.com>
 
 	* elf32-hppa.c (elf32_hppa_set_gp): Don't require an
diff --git a/bfd/elflink.c b/bfd/elflink.c
index bb1a30a..13647bb 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12338,7 +12338,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 	    get_vma:
 	      o = bfd_get_linker_section (dynobj, name);
 	    do_vma:
-	      if (o == NULL)
+	      if (o == NULL || bfd_is_abs_section (o->output_section))
 		{
 		  _bfd_error_handler
 		    (_("could not find section %s"), name);


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