Skip to content

Commit d4b2038

Browse files
authored
Merge pull request #3614 from masatake/cxx-side-chain
Cxx: extract section information from __attribute__((section("SECTION")))
2 parents 2c193d5 + 5c812c0 commit d4b2038

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1013
-39
lines changed

Tmain/list-fields-with-prefix.d/stdout-expected.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,23 @@ r UCTAGSroles no NONE s-- no r- Roles
88
x UCTAGSxpath no NONE s-- no -- xpath for the tag
99
- UCTAGSproperties yes Asm s-- no -- properties (req, vararg for parameters)
1010
- UCTAGSproperties no AutoIt s-- no -- properties (static, volatile, ...)
11+
- UCTAGSalias no C s-- no -- the name of the alias target specified in __attribute__((alias(...)))
1112
- UCTAGSmacrodef no C s-- no -- macro definition
1213
- UCTAGSproperties no C s-- no -- properties (static, inline, mutable,...)
14+
- UCTAGSsection no C s-- no -- the place where the object is placed
15+
- UCTAGSalias no C++ s-- no -- the name of the alias target specified in __attribute__((alias(...)))
1316
- UCTAGScaptures no C++ s-- no -- lambda capture list
1417
- UCTAGSmacrodef no C++ s-- no -- macro definition
1518
- UCTAGSname yes C++ s-- no -- aliased names
1619
- UCTAGSproperties no C++ s-- no -- properties (static, inline, mutable,...)
20+
- UCTAGSsection no C++ s-- no -- the place where the object is placed
1721
- UCTAGSspecialization no C++ s-- no -- template specialization parameters
1822
- UCTAGStemplate no C++ s-- no -- template parameters
1923
- UCTAGSmacrodef no CPreProcessor s-- no -- macro definition
24+
- UCTAGSalias no CUDA s-- no -- the name of the alias target specified in __attribute__((alias(...)))
2025
- UCTAGSmacrodef no CUDA s-- no -- macro definition
2126
- UCTAGSproperties no CUDA s-- no -- properties (static, inline, mutable,...)
27+
- UCTAGSsection no CUDA s-- no -- the place where the object is placed
2228
- UCTAGSmoduleName yes Elm s-- no -- actual name of renamed module
2329
- UCTAGSannotations yes GDScript s-- no -- annotations on functions and variables
2430
- UCTAGShowImported no Go s-- no -- how the package is imported ("inline" for `.' or "init" for `_')

Tmain/list-fields.d/stdout-expected.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,23 @@ x xpath no NONE s-- no -- xpath for the tag
2626
z kind no NONE s-- no r- [tags output] prepend "kind:" to k/ (or K/) field output, [xref and json output] kind in long-name form
2727
- properties yes Asm s-- no -- properties (req, vararg for parameters)
2828
- properties no AutoIt s-- no -- properties (static, volatile, ...)
29+
- alias no C s-- no -- the name of the alias target specified in __attribute__((alias(...)))
2930
- macrodef no C s-- no -- macro definition
3031
- properties no C s-- no -- properties (static, inline, mutable,...)
32+
- section no C s-- no -- the place where the object is placed
33+
- alias no C++ s-- no -- the name of the alias target specified in __attribute__((alias(...)))
3134
- captures no C++ s-- no -- lambda capture list
3235
- macrodef no C++ s-- no -- macro definition
3336
- name yes C++ s-- no -- aliased names
3437
- properties no C++ s-- no -- properties (static, inline, mutable,...)
38+
- section no C++ s-- no -- the place where the object is placed
3539
- specialization no C++ s-- no -- template specialization parameters
3640
- template no C++ s-- no -- template parameters
3741
- macrodef no CPreProcessor s-- no -- macro definition
42+
- alias no CUDA s-- no -- the name of the alias target specified in __attribute__((alias(...)))
3843
- macrodef no CUDA s-- no -- macro definition
3944
- properties no CUDA s-- no -- properties (static, inline, mutable,...)
45+
- section no CUDA s-- no -- the place where the object is placed
4046
- moduleName yes Elm s-- no -- actual name of renamed module
4147
- annotations yes GDScript s-- no -- annotations on functions and variables
4248
- howImported no Go s-- no -- how the package is imported ("inline" for `.' or "init" for `_')

Tmain/list-roles.d/stdout-expected.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#
55
#LANGUAGE KIND(L/N) NAME ENABLED DESCRIPTION
66
Ada p/package subunit on package name referenced in separate()
7-
Asm s/section placement on placement where the assembled code goes
87
AutoIt S/script local on local include
98
AutoIt S/script system on system include
109
Autoconf e/optenable cmdline on specified in a configure command line
@@ -72,8 +71,10 @@ Julia n/module imported on loaded by "import"
7271
Julia n/module namespace on only some symbols in it are imported
7372
Julia n/module used on loaded by "using"
7473
Kconfig k/kconfig source on kconfig file loaded with source directive
74+
LdScript i/inputSection destination on specified as the destination of code and data
7575
LdScript i/inputSection discarded on discarded when linking
7676
LdScript i/inputSection mapped on mapped to output section
77+
LdScript s/symbol aliased on aliased with __attribute__((alias(...))) in C/C++ code
7778
LdScript s/symbol entrypoint on entry points
7879
Lua Y/unknown referenced off referenced somehow
7980
M4 I/macrofile included on included macro
@@ -136,7 +137,6 @@ Zsh s/script loaded on loaded
136137
#
137138
#LANGUAGE KIND(L/N) NAME ENABLED DESCRIPTION
138139
Ada p/package subunit on package name referenced in separate()
139-
Asm s/section placement on placement where the assembled code goes
140140
AutoIt S/script local on local include
141141
AutoIt S/script system on system include
142142
Autoconf e/optenable cmdline on specified in a configure command line
@@ -204,8 +204,10 @@ Julia n/module imported on loaded by "import"
204204
Julia n/module namespace on only some symbols in it are imported
205205
Julia n/module used on loaded by "using"
206206
Kconfig k/kconfig source on kconfig file loaded with source directive
207+
LdScript i/inputSection destination on specified as the destination of code and data
207208
LdScript i/inputSection discarded on discarded when linking
208209
LdScript i/inputSection mapped on mapped to output section
210+
LdScript s/symbol aliased on aliased with __attribute__((alias(...))) in C/C++ code
209211
LdScript s/symbol entrypoint on entry points
210212
Lua Y/unknown referenced off referenced somehow
211213
M4 I/macrofile included on included macro
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
gfunc0 input.S /^GENTRY(gfunc0)$/;" s
12
gfunc0 input.S /^GENTRY(gfunc0)$/;" l
23
lfunc input.S /^LENTRY(lfunc)$/;" l
34
lfunc input.S /^LENTRY(lfunc)$/;" l
5+
gfunc1 input.S /^GENTRY(gfunc1)$/;" s
46
gfunc1 input.S /^GENTRY(gfunc1)$/;" l

Units/parser-asm.r/asm-cpp-macro-expansion.d/expected.tags

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
ENTRY input.S /^#define ENTRY(/;" d file: signature:(LABEL) macrodef:.global LABEL ;LABEL
2+
main input.S /^ENTRY(main):$/;" s
23
main input.S /^ENTRY(main):$/;" l
34
ENTRY2 input.S /^#define ENTRY2(/;" d file: signature:(LABEL,UNUSED) macrodef:.global LABEL ;LABEL
5+
loop0 input.S /^ENTRY2(loop0, "STRING"):$/;" s
46
loop0 input.S /^ENTRY2(loop0, "STRING"):$/;" l
7+
loop1 input.S /^ENTRY2(loop1, 'c'):$/;" s
58
loop1 input.S /^ENTRY2(loop1, 'c'):$/;" l
9+
loop2 input.S /^ENTRY2(loop2, ('c')):$/;" s
610
loop2 input.S /^ENTRY2(loop2, ('c')):$/;" l
711
ASM_NL input.S /^#define ASM_NL /;" d file: macrodef:;
812
SYM_ENTRY input.S /^#define SYM_ENTRY(/;" d file: signature:(name,linkage,align...) macrodef:linkage(name) ASM_NL align ASM_NL name:
@@ -12,8 +16,10 @@ asm_exc_nmi input.S /^SYM_CODE_START(asm_exc_nmi)$/;" l
1216
ENTRY0 input-0.S /^#define ENTRY0(/;" d file: signature:(LABEL) macrodef:.global LABEL ;LABEL
1317
exit0 input-0.S /^exit0:$/;" l
1418
ENTRY1 input-1.S /^#define ENTRY1(/;" d file: signature:(LABEL) macrodef:.global LABEL ;LABEL
19+
exit1 input-1.S /^ENTRY1(exit1):$/;" s
1520
exit1 input-1.S /^ENTRY1(exit1):$/;" l
1621
ENTRY2 input-2.S /^#define ENTRY2(/;" d file: signature:(LABEL) macrodef:.global LABEL ;LABEL
22+
exit2 input-2.S /^ENTRY2(exit2):$/;" s
1723
exit2 input-2.S /^ENTRY2(exit2):$/;" l
1824
ENTRY3 input-3.S /^#define ENTRY3 /;" d file: macrodef:label3:; nop;.section .entry.text,
1925
label3 input-3.S /^ ENTRY3"a"$/;" l
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
labelM input.s /^ .global labelM$/;" s
12
labelM input.s /^labelM:$/;" l
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
labelM input.S /^#define labelM /;" d file:
2+
labelM input.S /^ .global labelM$/;" s
23
labelM input.S /^labelM:$/;" l
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
--sort=no
22
--extras=+r
3-
--fields=+r
3+
--fields=+rlK
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
machine/asm.h input.s /^#include <machine\/asm.h>/;" h roles:system
2-
.rodata.cst8 input.s /^ .section .rodata.cst8,"aM",@progbits,8$/;" s roles:placement
3-
one input.s /^one: .double 1.0$/;" l roles:def
4-
limit input.s /^limit: .double 0.29$/;" l roles:def
1+
machine/asm.h input.s /^#include <machine\/asm.h>/;" header language:CPreProcessor roles:system
2+
.rodata.cst8 input.s /^ .section .rodata.cst8,"aM",@progbits,8$/;" inputSection language:LdScript roles:destination
3+
one input.s /^one: .double 1.0$/;" label language:Asm roles:def
4+
limit input.s /^limit: .double 0.29$/;" label language:Asm roles:def
5+
.inittext input-0.s /^ .section ".inittext","ax"$/;" inputSection language:LdScript roles:destination
6+
intcall input-0.s /^ .globl intcall$/;" symbol language:LdScript inputSection:.inittext roles:def
7+
intcall input-0.s /^intcall:$/;" label language:Asm roles:def
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* Taken from linux/arch/x86/boot/bioscall.S */
2+
3+
/*
4+
* "Glove box" for BIOS calls. Avoids the constant problems with BIOSes
5+
* touching registers they shouldn't be.
6+
*/
7+
8+
.code16
9+
.section ".inittext","ax"
10+
.globl intcall
11+
.type intcall, @function
12+
intcall:
13+
/* Self-modify the INT instruction. Ugly, but works. */
14+
cmpb %al, 3f

0 commit comments

Comments
 (0)