flat assembler
Message board for the users of flat assembler.
Index
> Linux > reloc problem |
Author |
|
Dex4u 04 Aug 2007, 14:38
Do they not work the same as: ? http://board.flatassembler.net/topic.php?t=4964&start=0
|
|||
04 Aug 2007, 14:38 |
|
nocona 05 Aug 2007, 05:11
afaik kernel know nothing about plt and got. it has its own symbols exporting mechanism and we just need to supply the rela relocation info with the accompanying symbol name.
|
|||
05 Aug 2007, 05:11 |
|
nocona 18 Aug 2007, 04:15
i download version 1.67.22 but the problem still occurs. so here's my patch for this problem..it just patch one file - formats.inc and fix rela section reloc entry generation. hopefully Tomasz can check it.
Code: diff -uprN fasm/source/formats.inc fasm-1.67.22/source/formats.inc --- fasm/source/formats.inc 2007-08-06 10:32:50.000000000 +0800 +++ fasm-1.67.22/source/formats.inc 2007-08-14 14:44:55.000000000 +0800 @@ -1,4 +1,3 @@ - ; flat assembler core ; Copyright (c) 1999-2007, Tomasz Grysztar. ; All rights reserved. @@ -3304,6 +3303,9 @@ elf_formatter: add esi,20h xchg edi,[esp] mov ebp,edi + ;added + push esi + ;added convert_relocations: cmp esi,[free_additional_memory] je relocations_converted @@ -3336,9 +3338,35 @@ elf_formatter: mov eax,[eax] shr eax,8 stos dword [edi] - xor eax,eax - stos dword [edi] - stos dword [edi] + ;removed + ;xor eax,eax + ;stos dword [edi] + ;stos dword [edi] + ;removed + ;added + ;int3 + push ebx ecx + mov ecx, [esp+8] + mov ebx, [ecx-20h+8] + add ebx, [esi+4] + xor eax, eax + xchg eax, [ebx] + stosd + movzx eax, byte [esi] + cmp al, 2 ;R_X86_64_PC32 + je .word32 + cmp al, 11 ;R_X86_64_32S + je .word32 + cmp al, 4 ;R_X86_64_PLT32 + je .word32 + xor eax, eax + xchg eax, [ebx+4] + stosd + jmp .done + .word32: + xor eax, eax + stosd + .done: + pop ecx ebx + ;added relocation_entry_ok: add esi,0Ch jmp convert_relocations @@ -3351,6 +3379,9 @@ elf_formatter: elf_machine_word_ok: ret relocations_converted: + ;added + add esp, 4 + ;added cmp edi,ebp xchg edi,[esp] je rel_section_ok Files fasm/source/Linux/fasm and fasm-1.67.22/source/Linux/fasm differ |
|||
18 Aug 2007, 04:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.