Skip to content

pragma weak ignoring more than 1 alias when placed before the declaration #28985

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 28611
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @hfinkel

Extended Description

cat a.c
#pragma weak a = bad
#pragma weak b = bad
#pragma weak c = bad
void bad(int *info ) { *info = 0 ; }

clang a.c -c
readelf -sW a.o
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS a.c
2: 0000000000000000 32 FUNC WEAK DEFAULT 2 a
3: 0000000000000000 32 FUNC GLOBAL DEFAULT 2 bad

Note that, the symbol b and c are missing.

This is gcc behavior:
8: 0000000000000000 52 FUNC GLOBAL DEFAULT 1 bad
9: 0000000000000000 52 FUNC WEAK DEFAULT 1 a
10: 0000000000000000 52 FUNC WEAK DEFAULT 1 b
11: 0000000000000000 52 FUNC WEAK DEFAULT 1 c

clang -v
clang version 3.9.0 (trunk 264998) (llvm/trunk 264997)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions