x.s 731 B

1234567891011121314151617181920212223242526272829
  1. ;# Main file, x.s, with the program (_start) referring to two
  2. ;# linkonce functions fn and fn2. The functions fn and fn2 are
  3. ;# supposed to be equivalent of C++ template instantiations; the
  4. ;# main file instantiates fn. An exception-table-lookalike entry
  5. ;# refers to fn via a local label. We use .gcc_except_table as we
  6. ;# can't be bothered to produce syntactically valid .eh_frame contents
  7. ;# and there's no option to turn off warning messages for invalid
  8. ;# contents.
  9. .text
  10. .global _start
  11. _start:
  12. .long fn
  13. .long fn2
  14. .section .gnu.linkonce.t.fn,"ax",@progbits
  15. .weak fn
  16. .type fn,@function
  17. fn:
  18. L:a:
  19. .long 1
  20. .long 2
  21. L:b:
  22. .size fn,L:b-L:a
  23. .section .gcc_except_table,"aw",@progbits
  24. .long 2
  25. .long L:a
  26. .long L:b-L:a