Commit 9c71afbd authored by John van Groningen's avatar John van Groningen

add PPC_RELOC_LOCAL_SECTDIFF

parent 83801940
......@@ -208,7 +208,7 @@ mark_used_modules main_symbol_n main_file_n exception_symbols marked_bool_a0 mar
| relocation_string BYTE relocation_index bitand 0x80<>0 // r_scattered
# r_kind = relocation_string BYTE relocation_index;
# r_type=r_kind bitand 0xf;
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF || r_type==PPC_RELOC_LOCAL_SECTDIFF
# relocation_index2=relocation_index+SIZE_OF_RELOCATION;
# r_kind2 = relocation_string BYTE relocation_index2;
| relocation_string BYTE relocation_index2 bitand 0x80==0 || r_kind2 bitand 0xf<>PPC_RELOC_PAIR
......@@ -966,7 +966,7 @@ relocate_text_or_data n_relocations virtual_address aligned_module_offset first_
[new_relocation_index+10]=toChar (new_diff>>24),
[new_relocation_index+11]=toChar (new_diff>>16)};
= relocate_text_or_data (relocation_n+2) (new_relocation_n+2) symbol_a text_a new_relocations;
| r_type==PPC_RELOC_SECTDIFF
| r_type==PPC_RELOC_SECTDIFF || r_type==PPC_RELOC_LOCAL_SECTDIFF
# address1 = determine_new_address r_value first_symbol_n section_offsets symbol_a module_offset_a section_addresses;
# address2 = determine_new_address r_value2 first_symbol_n section_offsets symbol_a module_offset_a section_addresses;
#! old_diff = text_a ILONG r_address;
......
......@@ -78,6 +78,7 @@ PPC_RELOC_HA16:==6;
PPC_RELOC_SECTDIFF:==8;
PPC_RELOC_LO16_SECTDIFF:==11;
PPC_RELOC_HA16_SECTDIFF:==12;
PPC_RELOC_LOCAL_SECTDIFF:==15;
STUB_SIZE:==36;
......
......@@ -98,6 +98,8 @@ PPC_RELOC_HI16_SECTDIFF:==10;
PPC_RELOC_LO16_SECTDIFF:==11;
PPC_RELOC_HA16_SECTDIFF:==12;
PPC_RELOC_JBSR:==13;
PPC_RELOC_LO14_SECTDIFF:==14;
PPC_RELOC_LOCAL_SECTDIFF:==15;
write_mach_o_headers :: !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !*File -> *File;
write_mach_o_headers text_section_size_align_4 data_section_size_align_4 bss_section_size_align_4 stubs_section_size_align_4 lazy_pointers_section_size_align_4 non_lazy_pointers_section_size_align_4
......@@ -859,7 +861,7 @@ next_relocation_address relocation_n section_relocations
| section_relocations BYTE relocation_index bitand 0x80<>0 // r_scattered
# r_kind = section_relocations BYTE relocation_index;
# r_type=r_kind bitand 0xf;
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF || r_type==PPC_RELOC_LO16 || r_type==PPC_RELOC_HA16
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF || r_type==PPC_RELOC_LOCAL_SECTDIFF || r_type==PPC_RELOC_LO16 || r_type==PPC_RELOC_HA16
= (section_relocations ITBYTE (relocation_index+1),2);
| r_type==PPC_RELOC_BR24 || r_type==PPC_RELOC_BR14 || (r_type==PPC_RELOC_VANILLA && r_kind bitand 0x30==0x20)
= (section_relocations ITBYTE (relocation_index+1),1);
......@@ -989,7 +991,7 @@ fill_relocations_of_text_or_data_modules relocation_n section_n_relocations firs
| section_relocations BYTE relocation_index bitand 0x80<>0 // r_scattered
# r_kind = section_relocations BYTE relocation_index;
# r_type=r_kind bitand 0xf;
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF || r_type==PPC_RELOC_LO16 || r_type==PPC_RELOC_HA16
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF || r_type==PPC_RELOC_LOCAL_SECTDIFF || r_type==PPC_RELOC_LO16 || r_type==PPC_RELOC_HA16
# r_address = section_relocations ITBYTE (relocation_index+1);
# (module_index,r_address,section_offsets) = determine_module_index_and_new_r_address r_address first_section_symbol_n limit_section_symbol_n section_virtual_address section_offsets;
#! next_relocation_offset = next_relocation_offsets.[module_index];
......@@ -1030,7 +1032,7 @@ fill_relocations_of_modules relocation_n section_n_relocations section_stub_size
| section_relocations BYTE relocation_index bitand 0x80<>0 // r_scattered
# r_kind = section_relocations BYTE relocation_index;
# r_type=r_kind bitand 0xf;
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF || r_type==PPC_RELOC_LOCAL_SECTDIFF
# r_address = section_relocations ITBYTE (relocation_index+1);
# module_index=r_address/section_stub_size;
# r_address=r_address-module_index*section_stub_size;
......@@ -1059,7 +1061,7 @@ fill_relocations_of_pointer_modules relocation_n section_n_relocations section_r
| section_relocations BYTE relocation_index bitand 0x80<>0 // r_scattered
# r_kind = section_relocations BYTE relocation_index;
# r_type=r_kind bitand 0xf;
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF
| r_type==PPC_RELOC_LO16_SECTDIFF || r_type==PPC_RELOC_HA16_SECTDIFF || r_type==PPC_RELOC_SECTDIFF || r_type==PPC_RELOC_LOCAL_SECTDIFF
# r_address = section_relocations ITBYTE (relocation_index+1);
# module_index=r_address>>2;
# r_address=r_address-(module_index<<2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment