Q:

the use of library functions in pic code

is this code PIC(position independant)?
as long as i know there must be no library functions in PIC code, but i am not sure that printf here considered as a library function.
also, after executing this code what is the value in edx register?
is it the absolute address of to_printf or printf or is it the difference of addresses of to_printf and next_i?
to_printf: dd printf
get_my_loc:
call next_i
next_i: 
pop edx
ret
call get_my_loc
push edx
add edx, (to_print - next_i)

A:

absolute address, identical to address of label next_i the first time you run into subroutine next_i.  after ret,
"push edx" is executed, with edx still containing the address of instruction "pop edx"
sequence of execution   effect
---------------------------------------------------------------------------------------------------------------------
call get_my_loc                addr of next instruction (push edx) stacked. call it "addr1"     
call next_i                          addr of next instruction (pop edx) stacked.  "addr2"
pop edx                             addr2 -> edx
ret                                      continues at addr1. addr2 was popped already.
; next operations work on edx, containing addr2, pointing to "pop edx"             
push edx    
add edx, ...

