flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > [req] rva enabled in ms coff |
Author |
|
revolution 13 Oct 2008, 15:27
I think that COFF format cannot support RVA because the linker won't know how to update the offset when it is linked?
|
|||
13 Oct 2008, 15:27 |
|
kempis 13 Oct 2008, 17:06
RVA = VA - base address
because base address is known, rva must be known when linked (just like plt/rva in elf format)[/code] |
|||
13 Oct 2008, 17:06 |
|
revolution 13 Oct 2008, 17:23
But how do you tell the linker that?
|
|||
13 Oct 2008, 17:23 |
|
kempis 13 Oct 2008, 17:31
I have ever read the PE and MS COFF format documentation. And there is something that tell the linker. I think it's the type of address.
|
|||
13 Oct 2008, 17:31 |
|
kempis 13 Oct 2008, 17:52
this is in pe/coff documentation
Quote:
|
|||
13 Oct 2008, 17:52 |
|
baldr 05 Nov 2008, 09:03
kempis,
I think it's about IMAGE_REL_I386_DIR32NB not supported by fasm COFF formatter, thus rva operator is allowed only in PE and ELF formats. Nevertheless, you have sources… |
|||
05 Nov 2008, 09:03 |
|
Tomasz Grysztar 06 Nov 2008, 11:01
Yeah, sorry, that was just my laziness - I never though someone would need to use RVA operator in COFF object.
|
|||
06 Nov 2008, 11:01 |
|
baldr 06 Nov 2008, 17:29
Tomasz Grysztar,
Don't be sorry: we must be thankful that you release your sources, not only binaries. So if somebody need some feature, he/she is free to modify the sources to achieve that goal. There ain't such a thing as a free lunch. |
|||
06 Nov 2008, 17:29 |
|
kempis 12 Nov 2008, 13:50
Thank's for all.
OK, it's difficult for me but I will try to modify the source. |
|||
12 Nov 2008, 13:50 |
|
vid 12 Nov 2008, 22:48
no need to modify, it will come soon.
|
|||
12 Nov 2008, 22:48 |
|
kempis 15 Nov 2008, 03:29
OK thank's very much.
BTW, I've modified it... EXPRESSI.INC Code: calculate_rva: cmp word [edi+8],0 jne invalid_expression cmp [output_format],5 je calculate_gotoff cmp [output_format],3 ;jne invalid_expression ;modified jne calculate_coff_rva ;/modified test [format_flags],8 jnz pe64_rva mov al,2 bt [resolver_flags],0 jc rva_type_ok xor al,al rva_type_ok: cmp byte [edi+12],al je rva_ok cmp [error_line],0 jne rva_ok mov eax,[current_line] mov [error_line],eax mov [error],invalid_use_of_symbol rva_ok: mov byte [edi+12],0 mov eax,[code_start] mov eax,[eax+34h] cdq sub [edi],eax sbb [edi+4],edx add edi,14h jmp calculation_loop ;modified calculate_coff_rva: mov dl,9 cmp byte[edi+12],2 jne incorrect_change_of_value_type jmp change_value_type ;/modified another code in EXPRESSI.INC Code: get_address_value: mov [address_size],0 mov [value_size],8 calculate_address: cmp byte [esi],'.' je invalid_address call calculate_expression mov eax,[edi+16] mov [address_symbol],eax mov al,[edi+12] mov [value_type],al cmp al,6 je plt_address ;modified cmp al,9 je plt_address ;/modified cmp al,5 je gotoff_address ja invalid_use_of_symbol FORMATS.INC Code: mark_coff_relocation: cmp [value_type],3 je coff_relocation_relative ;modified cmp [value_type],9 je coff_relocation_rva ;/modified push ebx eax test [format_flags],8 jnz coff_64bit_relocation mov al,6 jmp coff_relocation ;modified coff_relocation_rva: push ebx eax mov al,7 jmp coff_relocation ;/modified But I still wait for new version... |
|||
15 Nov 2008, 03:29 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.