No, that's correct. Is it *not* returning a different return address, depending where it's called from? That seems strange...
I deduce from the trailing underscore that you're calling it from Fortran. Possible that Fortran "consolidates" calls, in some manner??? Seems unlikely. Try it with this caller...
; nasm -f elf32 calliaddr.asm
; ld -o calliaddr calladdr.o iaddr.o
; strip -R.comment calladdr if you like
global _start
extern iaddr_
section .text
_start:
call iaddr_
call showeaxh
times 100h nop
call iaddr_
call showeaxh
mov eax, 1 ;__NR_exit
int 80h
;------------------------------
showeaxh:
push eax
push ebx
push ecx
push edx
sub esp, 10h
mov ecx, esp
xor edx, edx
mov ebx, eax
.top:
rol ebx, 4
mov al, bl
and al, 0Fh
cmp al, 0Ah
sbb al, 69h
das
mov [ecx + edx], al
inc edx
cmp edx, 8
jnz .top
mov byte [ecx + edx], 10 ; linefeed
inc edx
mov ebx, 1
mov eax, 4
int 80h
add esp, 10h
pop edx
pop ecx
pop ebx
pop eax
ret
;------------------------------
That seems to return different numbers, differing by about the expected amount. Haven't actually counted bytes...
(as you can probably tell, I don't "trust" HLLs much - who knows *what* they're doing behind your back? If all else fails, we can disassemble the executable...)
Best,
Frank