X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gas%2Fconfig%2Fobj-elf.c;h=7cf921c051f62b4cd73b867e7d203cc3fec284fe;hb=f1f28025c3ea75d5368ddd3046461648145b89b3;hp=56293584a0aa7065b4228f2b5d1b69e5e73b09c0;hpb=fd3619828e94a24a92cddec42cbc0ab33352eeb4;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 56293584a0..7cf921c051 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -1,5 +1,5 @@ /* ELF object file format - Copyright (C) 1992-2019 Free Software Foundation, Inc. + Copyright (C) 1992-2020 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -33,6 +33,7 @@ #ifdef NEED_ECOFF_DEBUG #include "ecoff.h" +#include "bfd/ecoff-bfd.h" #endif #ifdef TC_ALPHA @@ -1038,6 +1039,18 @@ obj_elf_section (int push) name = obj_elf_section_name (); if (name == NULL) return; + + symbolS * sym; + if ((sym = symbol_find (name)) != NULL + && ! symbol_section_p (sym) + && S_IS_DEFINED (sym) + && ! S_IS_VOLATILE (sym) + && ! S_CAN_BE_REDEFINED (sym)) + { + as_bad (_("section name '%s' already defined as another symbol"), name); + ignore_rest_of_line (); + return; + } type = SHT_NULL; attr = 0; gnu_attr = 0;