2019-07-17 22:54:02 +08:00
/ / REQUIRES : x8 6
/ / RUN : llvm- m c - f i l e t y p e =obj - t r i p l e =x86_64 - p c - l i n u x % s - o % t . o
/ / RUN : not l d . l l d - s h a r e d - - v s - d i a g n o s t i c s % t . o - o / d e v / n u l l 2 > & 1 | F i l e C h e c k % s
/ / CHECK : dyn. s ( 1 5 ) : e r r o r : c a n ' t c r e a t e d y n a m i c r e l o c a t i o n R _ X 8 6 _ 6 4 _ 6 4 a g a i n s t l o c a l s y m b o l i n r e a d o n l y s e g m e n t ; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
/ / CHECK- N E X T : > > > d e f i n e d i n { { . * } } . o
/ / CHECK- N E X T : > > > r e f e r e n c e d b y d y n . s : 1 5
/ / CHECK- N E X T : > > > { { . * } } . o : ( . t e x t + 0 x { { . + } } )
2019-08-09 16:29:03 +08:00
/ / CHECK : / tmp{ { / | \ \ } } d y n . s ( 2 0 ) : e r r o r : c a n ' t c r e a t e d y n a m i c r e l o c a t i o n { { . * } }
/ / CHECK- N E X T : > > > d e f i n e d i n { { . * } } . o
/ / CHECK- N E X T : > > > r e f e r e n c e d b y d y n . s : 2 0 ( / t m p { { / | \ \ } } d y n . s : 2 0 )
/ / CHECK- N E X T : > > > { { . * } } . o : ( . t e x t + 0 x { { . + } } )
2019-07-17 22:54:02 +08:00
.file 1 " dyn. s "
.loc 1 1 5
foo :
.quad foo
2019-08-09 16:29:03 +08:00
.file 2 " / tmp" " d y n . s "
.loc 2 2 0
bar :
.quad bar
2019-07-17 22:54:02 +08:00
.section .debug_abbrev , " " , @progbits
.byte 1 # Abbreviation C o d e
.byte 17 # DW_ T A G _ c o m p i l e _ u n i t
.byte 0 # DW_ C H I L D R E N _ n o
.byte 16 # DW_ A T _ s t m t _ l i s t
.byte 23 # DW_ F O R M _ s e c _ o f f s e t
.byte 0 # EOM( 1 )
.byte 0 # EOM( 2 )
.byte 0 # EOM( 3 )
.section .debug_info , " " , @progbits
.long .Lend0 - .Lbegin0 # Length o f U n i t
.Lbegin0 :
.short 4 # DWARF v e r s i o n n u m b e r
.long .debug_abbrev # Offset I n t o A b b r e v . S e c t i o n
.byte 8 # Address S i z e ( i n b y t e s )
.byte 1 # Abbrev [ 1 ] 0 x b : 0 x1 f D W _ T A G _ c o m p i l e _ u n i t
.long .debug_line # DW_ A T _ s t m t _ l i s t
.Lend0 :
.section .debug_line , " " , @progbits