Skip to content

Commit 3ff5f78

Browse files
Peter Zijlstrasuryasaimadhu
authored andcommitted
linkage: Fix issue with missing symbol size
Occasionally, typically when a function doesn't end with 'ret', an alias on that function will have 0 size. The difference between what GCC generates and our linkage magic, is that GCC doesn't appear to provide .size for the alias'ed symbol at all. And indeed, removing this directive cures the issue. Additionally, GCC also doesn't emit .type for alias symbols either, so also omit that. Fixes: e089126 ("linkage: add SYM_FUNC_ALIAS{,_LOCAL,_WEAK}()") Suggested-by: Mark Rutland <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Mark Rutland <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1b331ee commit 3ff5f78

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

include/linux/linkage.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,9 @@
171171

172172
/* SYM_ALIAS -- use only if you have to */
173173
#ifndef SYM_ALIAS
174-
#define SYM_ALIAS(alias, name, sym_type, linkage) \
175-
linkage(alias) ASM_NL \
176-
.set alias, name ASM_NL \
177-
.type alias sym_type ASM_NL \
178-
.set .L__sym_size_##alias, .L__sym_size_##name ASM_NL \
179-
.size alias, .L__sym_size_##alias
174+
#define SYM_ALIAS(alias, name, linkage) \
175+
linkage(alias) ASM_NL \
176+
.set alias, name ASM_NL
180177
#endif
181178

182179
/* === code annotations === */
@@ -261,23 +258,23 @@
261258
*/
262259
#ifndef SYM_FUNC_ALIAS
263260
#define SYM_FUNC_ALIAS(alias, name) \
264-
SYM_ALIAS(alias, name, SYM_T_FUNC, SYM_L_GLOBAL)
261+
SYM_ALIAS(alias, name, SYM_L_GLOBAL)
265262
#endif
266263

267264
/*
268265
* SYM_FUNC_ALIAS_LOCAL -- define a local alias for an existing function
269266
*/
270267
#ifndef SYM_FUNC_ALIAS_LOCAL
271268
#define SYM_FUNC_ALIAS_LOCAL(alias, name) \
272-
SYM_ALIAS(alias, name, SYM_T_FUNC, SYM_L_LOCAL)
269+
SYM_ALIAS(alias, name, SYM_L_LOCAL)
273270
#endif
274271

275272
/*
276273
* SYM_FUNC_ALIAS_WEAK -- define a weak global alias for an existing function
277274
*/
278275
#ifndef SYM_FUNC_ALIAS_WEAK
279276
#define SYM_FUNC_ALIAS_WEAK(alias, name) \
280-
SYM_ALIAS(alias, name, SYM_T_FUNC, SYM_L_WEAK)
277+
SYM_ALIAS(alias, name, SYM_L_WEAK)
281278
#endif
282279

283280
/* SYM_CODE_START -- use for non-C (special) functions */

0 commit comments

Comments
 (0)