{"id":351,"date":"2022-08-30T14:59:54","date_gmt":"2022-08-30T14:59:54","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/06\/problem-about-relocation-collection-of-common-programming-errors\/"},"modified":"2022-08-30T14:59:54","modified_gmt":"2022-08-30T14:59:54","slug":"problem-about-relocation-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-relocation-collection-of-common-programming-errors\/","title":{"rendered":"problem about relocation-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/68fdb443d91137df1411a119e2a3287f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nblissfreak<br \/>\nlinker nasm relocation truncated<br \/>\nI&#8217;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&#8217;8250;in condizione di loopback , cio\u00e8 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&#8217;INTERRUZIONEINTIDENTIF EQU 03FAH ;REGISTRO DI IDENTIFICAZIONE DELL&#8217;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 -&gt;BAUD =9600COUNTERCHAR DB 0 ;CHARACTER COUNTER;DW 256 DUP (?)section .textglobal _sta<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a9d61cdbe90d3bdd8bde1cb50fdf05f1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPavan Manjunath<br \/>\nlinux-kernel cross-compiling kernel-module sparc relocation<br \/>\nFirst 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 &lt; 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 &gt;&gt;<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-06 03:13:46. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>blissfreak linker nasm relocation truncated I&#8217;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&#8217;8250;in condizione di loopback , cio\u00e8 Tx=Rxsection .code64section .dataTXDATA EQU 03F8H ;TRASMETTITORERXDATA EQU 03F8H [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-351","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/351\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}