Im not sure why you're getting the error - not that I know which assembler variant you're running
one thing I did see, was that perhaps this ..
mov $4, %eax #Print Nameinput
mov $1, %ebx
mov $nameinput, %ecx
mov length_nameinput, %edx
int $0x80
mov $1, %eax #exit program
int $0x80
should be this (ie, get and save the answer, then print the Nameinput fixed text, then print the answer)
mov $4, %eax #Print Nameinput
mov $1, %ebx
mov $nameinput, %ecx
mov length_nameinput, %edx
int $0x80
mov $4, %eax #Print answer (name)
mov $1, %ebx
mov $answer, %ecx
mov answer_length, %edx
int $0x80
mov $1, %eax #exit program
int $0x80
btw, consistency is good - you have length_greeting, length_nameinput, but answer_length