This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[Ada] Give error message if duplicate Linker_Section given


Like other similar pragmas, we should disallow duplicate pragma or
aspect Linker_Section for non-overloadable entities (for the case
of overloading, the pragma only applies to previous entities which
do not have such a pragma).

The following should compile with the given error:

     1. package Pkg1 is
     2.    Var_Dyn : natural;
     3.    pragma Linker_Section (Var_Dyn, ".data_dyn");
     4.    pragma Linker_Section (Var_Dyn, ".data_dyn1");
                                  |
        >>> Linker_Section already specified for "Var_Dyn" at line 3

     5. end Pkg1;

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-11-20  Robert Dewar  <dewar@adacore.com>

	* sem_prag.adb (Analyze_Pragma, case Linker_Section): Detect
	duplicate Linker_Section.

Attachment: difs
Description: Text document


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