elfver.S 649 B

12345678910111213141516171819202122232425262728293031
  1. # Compile with:
  2. # ARGS="-shared -nostdlib -Wl,--version-script=elfver.script"
  3. # clang $ARGS -m32 elfver.S -lc -o elf-versioning-test.i386
  4. # clang $ARGS -m64 elfver.S -lc -o elf-versioning-test.x86_64
  5. # Also, strip off non-dynamic symbols:
  6. # strip elf-versioning-test.i386
  7. # strip elf-versioning-test.x86_64
  8. #ifdef __i386__
  9. .symver _puts, puts@GLIBC_2.0
  10. #else
  11. .symver _puts, puts@GLIBC_2.2.5
  12. #endif
  13. call _puts@PLT
  14. .symver foo1, foo@VER1
  15. .globl foo1
  16. .type foo1, @function
  17. foo1:
  18. ret
  19. .symver foo2, foo@@VER2
  20. .globl foo2
  21. .type foo2, @function
  22. foo2:
  23. ret
  24. .globl unversioned_define
  25. .type unversioned_define, @function
  26. unversioned_define: