home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,065 of 4,675   
   aen@nospicedham.spamtrap.com to All   
   linking   
   12 Nov 17 13:00:17   
   
   Hi!   
      
   I can assemble and link the source in my "cycles" post with:   
      
   as -gdwarf2 -o posting.o posting.asm   
   gcc -static -o posting posting.o   
   That gives an executable with 811856 bytes.   
      
   gcc -o posting posting.o   
   produces:   
   /usr/bin/ld: posting.o: relocation R_X86_64_32S against `.data' can   
   not be used when making a shared object; recompile with -fPIC   
   /usr/bin/ld: final link failed: Nonrepresentable section on output   
   collect2: error: ld returned 1 exit status   
      
   But with that command I can link a dynamic executable:   
   ld -dynamic-linker /lib64/ld-linux-x86-64.so.2   
   /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o   
   posting.o /usr/lib/x86_64-linux-gnu/crtn.o -lc -o posting   
   That gives an executable with 8224 bytes.   
      
   Why doesn't gcc use the right object files in the link?   
   --   
   aen   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca