problem about relocation-Collection of common programming errors


  • blissfreak
    linker nasm relocation truncated
    I’m using a computer with an Intel Core 2 CPU and 2GB of RAM. The SO is Ubuntu 9.04. When I try to compile this code:;programma per la simulazione di un terminale su PC, ottenuto utilizzando l’8250;in condizione di loopback , cio√® Tx=Rxsection .code64section .dataTXDATA EQU 03F8H ;TRASMETTITORERXDATA EQU 03F8H ;RICEVITOREBAUDLSB EQU 03F8H ;DIVISORE DI BAUD RATE IN LSBBAUDMSB EQU 03F9H ;DIVISORE DI BAUD RATE IN MSBINTENABLE EQU 03F9H ;REGISTRO DI ABILITAZIONE DELL’INTERRUZIONEINTIDENTIF EQU 03FAH ;REGISTRO DI IDENTIFICAZIONE DELL’INTERRUZIONELINECTRL EQU 03FBH ;REGISTRO DI CONTROLLO DELLA LINEAMODEMCTRL EQU 03FCH ;REGISTRO DI CONTROLLO DEL MODEMLINESTATUS EQU 03FDH ;REGISTRO DI STATO DELLA LINEAMODEMSTATUS EQU 03FEH ;REGISTRO DI STATO DEL MODEMBAUDRATEDIV DW 0060H ;DIVISOR: LOW=60, HIGH=00 ->BAUD =9600COUNTERCHAR DB 0 ;CHARACTER COUNTER;DW 256 DUP (?)section .textglobal _sta

  • Pavan Manjunath
    linux-kernel cross-compiling kernel-module sparc relocation
    First off: I am not an expert, so please excuse any mistakes I make trying to explain myself.I am trying to cross-compile an external Linux module for a SPARC machine using Sparc-Linux-GCC-4.4.2. The version of the Linux kernel is 2.6.36.4-00037-g059aa91-dirty. It has been patched with some files from the LEON processor. The build flow is provided to me and it uses LinuxBuild, Buildroot, and Busybox. I am trying to make a 32 bit OS.Everything seems to work but after I compile the module and try to insmod it to the SPARC system I get this error:module hellok: Unknown relocation: 6This error comes from ~/linuxbuild-1.0.3/linux/linux-2.6-git/arch/sparc/kernel/module.c I will provide the whole method for the sake of completeness:int apply_relocate_add(Elf_Shdr *sechdrs,const char *strtab,unsigned int symindex,unsigned int relsec,struct module *me) { unsigned int i; Elf_Rela *rel = (void *)sechdrs[relsec].sh_addr; Elf_Sym *sym; u8 *location; u32 *loc32;for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {Elf_Addr v;/* This is where to make the change */location = (u8 *)sechdrs[sechdrs[relsec].sh_info].sh_addr+ rel[i].r_offset;loc32 = (u32 *) location;#ifdef CONFIG_SPARC64BUG_ON(((u64)location >>

Originally posted 2013-11-06 03:13:46.