Skip to content

Commit b5cb2f1

Browse files
committed
Fix incorrect heading levels
1 parent aafb1d3 commit b5cb2f1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

text/3543-patchable-function-entry.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ This design has two drawbacks:
117117

118118
The primary advantage of this design is that it is purely a compiler feature, with no change to the language.
119119

120-
## Compiler flag and no-padding attribute
120+
### Compiler flag and no-padding attribute
121121
In this design, we add the compiler flag and an attribute that zeroes out padding for a function. This covers all the use cases I see in the Linux kernel today, so the only real downside is missing the opportunity to match `gcc` and `clang`'s capabilities with only a small bit more code.
122122

123123
Some other project might use explicit padding configuration per-function, but a quick search across github only finds the `patchable_function_entry` attribute set to `(0, 0)` other than in compiler tests.
124124

125-
## Everything (proposed design)
125+
### Everything (proposed design)
126126
The only real downside I see here is the complexity of adding one more thing to the language.
127127

128-
# Argument style
128+
## Argument style
129129

130130
There are two basic ways being used today to specify this nop padding:
131131

@@ -136,21 +136,21 @@ The primary advantage of the first format is that it is used in `gcc` and `clang
136136

137137
The advantage of the second style is that `prefix` and `entry` don't have validity constraints (`nop_count` must be greater than `offset`) and it's more obvious what the user is asking for.
138138

139-
## Copy `gcc`/`clang` everywhere
139+
### Copy `gcc`/`clang` everywhere
140140

141141
This approach has the advantage of matching all existing docs and programmers coming over not being confused.
142142

143-
## Use LLVM-style everywhere
143+
### Use LLVM-style everywhere
144144

145145
This format doesn't require validation and is likely easier to understand for users not already exposed to this concept.
146146

147-
## Use `gcc`/`clang` for flags, LLVM-style for arguments (proposed)
147+
### Use `gcc`/`clang` for flags, LLVM-style for arguments (proposed)
148148

149149
Build systems tend to interact with our flag interface, and they already have `nop_count,offset` format flags constructed for their C compilers, so this is likely the easiest way for them to interface.
150150

151151
Users are unlikely to be directly copying code with a manual attribute, and usually are just going to be disabling padding per a github search for the attribute. Setting padding to `(0, 0)` is compatible across both styles, and setting `prefix` and `entry` manually is likely to be more understandable for a new user.
152152

153-
## Use `gcc`/`clang` for flags, Support both styles for arguments
153+
### Use `gcc`/`clang` for flags, Support both styles for arguments
154154

155155
Our attribute system is more powerful than `clang` and `gcc`, so we have the option to support:
156156

@@ -161,7 +161,7 @@ Our attribute system is more powerful than `clang` and `gcc`, so we have the opt
161161

162162
as modifiers to the attribute. We could make `prefix`/`entry` vs `nop_count`/`offset` an exclusive choice, and support both. This would provide the advantage of allowing users copying from or familiar with the other specification system to continue using it. The disadvantages would be more complex attribute parsing and potential confusion for people reading code.
163163

164-
## Support both styles for flags and arguments
164+
### Support both styles for flags and arguments
165165

166166
In addition to supporting `nop_count`/`offset` for attributes, we could support this on the command line as well. This would have two forms:
167167

@@ -172,7 +172,7 @@ This would have the benefit of making it more clear what's being specified and a
172172

173173
The primary disadvantage of this is having many ways to say the same thing.
174174

175-
## Use LLVM-style for flags, `gcc`/`clang` for arguments
175+
### Use LLVM-style for flags, `gcc`/`clang` for arguments
176176

177177
I'm not sure why we would do this.
178178

0 commit comments

Comments
 (0)