From: Ian Lance Taylor Date: Thu, 13 Mar 1997 16:21:34 +0000 (+0000) Subject: * config/obj-elf.c (obj_elf_data): Call md_flush_pending_output X-Git-Tag: gdb-4_18~6184 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e9974a4504db68072a7b373bbb3d13ea574505a;p=external%2Fbinutils.git * config/obj-elf.c (obj_elf_data): Call md_flush_pending_output and md_elf_section_change_hook if they are defined. (obj_elf_text, obj_elf_previous): Likewise. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index cef223f..b4679d6 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,18 @@ +Thu Mar 13 11:20:51 1997 Ian Lance Taylor + + * config/obj-elf.c (obj_elf_data): Call md_flush_pending_output + and md_elf_section_change_hook if they are defined. + (obj_elf_text, obj_elf_previous): Likewise. + Wed Mar 12 11:40:20 1997 Ian Lance Taylor + * config/obj-multi.h (struct elf_obj_sy): Define if + OBJ_MAYBE_ELF. + (OBJ_SYMFIELD_TYPE): Define as struct elf_obj_sy if + OBJ_MAYBE_ELF. + * config/obj-elf.h (struct elf_obj_sy): Don't define if + OBJ_SYMFIELD_TYPE is defined. + * doc/as.texinfo (bss): Improve description of .bss section. In ELF or COFF, you are permitted to switch into the section. (Comm): Rewrite description of common symbols. diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 38a909a..6f13bb6 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -806,9 +806,17 @@ static void obj_elf_data (i) int i; { +#ifdef md_flush_pending_output + md_flush_pending_output (); +#endif + previous_section = now_seg; previous_subsection = now_subseg; s_data (i); + +#ifdef md_elf_section_change_hook + md_elf_section_change_hook (); +#endif } /* Change to the .text section. */ @@ -817,9 +825,17 @@ static void obj_elf_text (i) int i; { +#ifdef md_flush_pending_output + md_flush_pending_output (); +#endif + previous_section = now_seg; previous_subsection = now_subseg; s_text (i); + +#ifdef md_elf_section_change_hook + md_elf_section_change_hook (); +#endif } void @@ -831,8 +847,17 @@ obj_elf_previous (ignore) as_bad (".previous without corresponding .section; ignored"); return; } + +#ifdef md_flush_pending_output + md_flush_pending_output (); +#endif + subseg_set (previous_section, previous_subsection); previous_section = 0; + +#ifdef md_elf_section_change_hook + md_elf_section_change_hook (); +#endif } static void @@ -865,6 +890,15 @@ obj_elf_symver (ignore) sym = symbol_find_or_make (name); *input_line_pointer = c; + + if (sym->sy_obj.versioned_name != NULL) + { + as_bad ("multiple .symver directives for symbol `%s'", + S_GET_NAME (sym)); + ignore_rest_of_line (); + return; + } + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { @@ -887,6 +921,14 @@ obj_elf_symver (ignore) *input_line_pointer = c; + if (strchr (sym->sy_obj.versioned_name, ELF_VER_CHR) == NULL) + { + as_bad ("missing version name in `%s' for symbol `%s'", + sym->sy_obj.versioned_name, S_GET_NAME (sym)); + ignore_rest_of_line (); + return; + } + demand_empty_rest_of_line (); } @@ -1255,7 +1297,22 @@ elf_frob_symbol (symp, puntp) approach. */ if (! S_IS_DEFINED (symp)) - S_SET_NAME (symp, symp->sy_obj.versioned_name); + { + char *p; + + /* Verify that the name isn't using the @@ syntax--this is + reserved for definitions of the default version to link + against. */ + p = strchr (symp->sy_obj.versioned_name, ELF_VER_CHR); + know (p != NULL); + if (p[1] == ELF_VER_CHR) + { + as_bad ("invalid attempt to declare external version name as default in symbol `%s'", + symp->sy_obj.versioned_name); + *puntp = true; + } + S_SET_NAME (symp, symp->sy_obj.versioned_name); + } else { symbolS *symp2;