Skip to content

Commit

Permalink
fixed symbol versioning test case
Browse files Browse the repository at this point in the history
  • Loading branch information
hariharan-devarajan committed Nov 28, 2023
1 parent ebc5e85 commit e00c9ba
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04 ]
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-23.04]

name: ${{ matrix.os }}

Expand Down
9 changes: 3 additions & 6 deletions test/symver/retX_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ for more details. You should have received a copy of the GNU Lesser General
Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

int retX_new(int x) { return x; }
__asm__(
"\t.globl __retX_new\n"
"\t.equiv __retX_new,retX_new\n"
"\t.symver __retX_new,retX@@GOTCHA_2");
#include "sym_macro.h"
SYMVER_ATTRIBUTE(retX_new, retX @ @GOTCHA_2)
int retX_new(int x) { return x; }
7 changes: 2 additions & 5 deletions test/symver/retX_old.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ for more details. You should have received a copy of the GNU Lesser General
Public License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "sym_macro.h"
SYMVER_ATTRIBUTE(retX_old, retX @GOTCHA_1)
int retX_old(int x) { return -x; }
__asm__(
"\t.globl __retX_old\n"
"\t.equiv __retX_old,retX_old\n"
"\t.symver __retX_old,retX@GOTCHA_1");
16 changes: 16 additions & 0 deletions test/symver/sym_macro.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef GOTCHA_SYM_MACRO_H
#define GOTCHA_SYM_MACRO_H
#ifdef __has_attribute
#if __has_attribute(__symver__)
#define SYMVER_ATTRIBUTE(sym, symver) __attribute__((__symver__(#symver)))
#endif
#endif
#ifndef SYMVER_ATTRIBUTE
#define SYMVER_ATTRIBUTE(sym, symver) \
__asm__("\t.globl __" #sym \
"\n" \
"\t.equiv __" #sym "," #sym \
"\n" \
"\t.symver __" #sym "," #symver);
#endif
#endif // GOTCHA_SYM_MACRO_H

0 comments on commit e00c9ba

Please sign in to comment.