This patch modifies the output of the representation information related to aspect or pragma Linker_Section, achieved with compiler switch -gnatR2. The value of the section argument is now properly retrieved. Previously it was assumed that the value is always a N_String_Literal, however the semantics of the annotation allow for any static string expression, including a reference to a static string. ------------ -- Source -- ------------ -- linker_sections.ads package Linker_Sections is LS_1 : constant String := "1"; LS_2 : constant String := "2" & "2"; LS_3 : constant String := LS_1 & "3"; LS_4 : constant String := "4" & LS_2; Val_1 : Integer with Linker_Section => LS_1; Val_2 : Integer with Linker_Section => LS_2; Val_3 : Integer with Linker_Section => LS_3; Val_4 : Integer with Linker_Section => LS_4; Val_5 : Integer with Linker_Section => LS_1 & "5"; Val_6 : Integer with Linker_Section => LS_2 & "6"; Val_7 : Integer with Linker_Section => LS_3 & "7"; Val_8 : Integer with Linker_Section => LS_4 & "8"; Val_9 : Integer with Linker_Section => "9" & LS_1; Val_10 : Integer with Linker_Section => "10" & LS_2; Val_11 : Integer with Linker_Section => "11" & LS_3; Val_12 : Integer with Linker_Section => "12" & LS_4; Val_13 : Integer; pragma Linker_Section (Val_13, LS_1); Val_14 : Integer; pragma Linker_Section (Val_14, LS_2); Val_15 : Integer; pragma Linker_Section (Val_15, LS_3); Val_16 : Integer; pragma Linker_Section (Val_16, LS_4); Val_17 : Integer; pragma Linker_Section (Val_17, LS_1 & "5"); Val_18 : Integer; pragma Linker_Section (Val_18, LS_2 & "6"); Val_19 : Integer; pragma Linker_Section (Val_19, LS_3 & "7"); Val_20 : Integer; pragma Linker_Section (Val_20, LS_4 & "8"); Val_21 : Integer; pragma Linker_Section (Val_21, "9" & LS_1); Val_22 : Integer; pragma Linker_Section (Val_22, "10" & LS_2); Val_23 : Integer; pragma Linker_Section (Val_23, "11" & LS_3); Val_24 : Integer; pragma Linker_Section (Val_24, "12" & LS_4); end Linker_Sections; ----------------- -- Compilation -- ----------------- $ gcc -c -gnatR2s linker_sections.ads 2018-05-28 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * repinfo.adb (Expr_Value_S): New routine. (List_Linker_Section): Properly extract the value of the section argument. From-SVN: r260825
Name |
Last commit
|
Last update |
---|---|---|
INSTALL | Loading commit data... | |
config | Loading commit data... | |
contrib | Loading commit data... | |
fixincludes | Loading commit data... | |
gcc | Loading commit data... | |
gnattools | Loading commit data... | |
gotools | Loading commit data... | |
include | Loading commit data... | |
intl | Loading commit data... | |
libada | Loading commit data... | |
libatomic | Loading commit data... | |
libbacktrace | Loading commit data... | |
libcc1 | Loading commit data... | |
libcpp | Loading commit data... | |
libdecnumber | Loading commit data... | |
libffi | Loading commit data... | |
libgcc | Loading commit data... | |
libgfortran | Loading commit data... | |
libgo | Loading commit data... | |
libgomp | Loading commit data... | |
libhsail-rt | Loading commit data... | |
libiberty | Loading commit data... | |
libitm | Loading commit data... | |
libmpx | Loading commit data... | |
libobjc | Loading commit data... | |
liboffloadmic | Loading commit data... | |
libquadmath | Loading commit data... | |
libsanitizer | Loading commit data... | |
libssp | Loading commit data... | |
libstdc++-v3 | Loading commit data... | |
libvtv | Loading commit data... | |
lto-plugin | Loading commit data... | |
maintainer-scripts | Loading commit data... | |
zlib | Loading commit data... | |
.dir-locals.el | Loading commit data... | |
.gitattributes | Loading commit data... | |
.gitignore | Loading commit data... | |
ABOUT-NLS | Loading commit data... | |
COPYING | Loading commit data... | |
COPYING.LIB | Loading commit data... | |
COPYING.RUNTIME | Loading commit data... | |
COPYING3 | Loading commit data... | |
COPYING3.LIB | Loading commit data... | |
ChangeLog | Loading commit data... | |
ChangeLog.jit | Loading commit data... | |
ChangeLog.tree-ssa | Loading commit data... | |
MAINTAINERS | Loading commit data... | |
Makefile.def | Loading commit data... | |
Makefile.in | Loading commit data... | |
Makefile.tpl | Loading commit data... | |
README | Loading commit data... | |
compile | Loading commit data... | |
config-ml.in | Loading commit data... | |
config.guess | Loading commit data... | |
config.rpath | Loading commit data... | |
config.sub | Loading commit data... | |
configure | Loading commit data... | |
configure.ac | Loading commit data... | |
depcomp | Loading commit data... | |
install-sh | Loading commit data... | |
libtool-ldflags | Loading commit data... | |
libtool.m4 | Loading commit data... | |
ltgcc.m4 | Loading commit data... | |
ltmain.sh | Loading commit data... | |
ltoptions.m4 | Loading commit data... | |
ltsugar.m4 | Loading commit data... | |
ltversion.m4 | Loading commit data... | |
lt~obsolete.m4 | Loading commit data... | |
missing | Loading commit data... | |
mkdep | Loading commit data... | |
mkinstalldirs | Loading commit data... | |
move-if-change | Loading commit data... | |
symlink-tree | Loading commit data... | |
ylwrap | Loading commit data... |