kolibrios/programs
boppan 18f26e7cf9 [clink] Make it able to read and write more than 64k - 1 COFF relocation
These are changes from two commits from the upstream clink repo (https://github.com/mkostoevr/clink) and one commit from the upstream epep repo (https://github.com/mkostoevr/epep).

clink:

    Commit e63ed12ead17e47d77e848da0e7b9f4dd3ad5127
    Bugfix: Make it able to write more than 64k - 1 COFF relocations
    
    If the relocation count is greater than 0xffff then it can't fit
    in the NumberOfRelocations field of a section header. In order to
    specify greater relocation count IMAGE_SCN_LNK_NRELOC_OVFL flag
    should be added to Characteristics and the actual relocation count
    should be written into VirtualAddress field of the first COFF
    relocation.
    
    Commit 328fc3112a30fcaa808f2cad34028a6507d602a3
    Bugfix: Make it able to read more than 64k - 1 COFF relocations
    
    New EPEP API allows to read more than 64k - 1 relocations. Use it
    when reading relocation count for filling SectionInfo and when
    reading relocations for wriring the output file.

epep:

    Commit 3bed4e348a486c346d0a452c58c1d85e1805c09d
    Feature: Higher-level COFF relocations API
    
    Number of COFF relocations of a section is stored in the 16-bit
    NumberOfRelocations field of a section header. If a COFF object has
    more than 2^16 - 1 relocations, then the value does not fit in the
    field.
    
    To solve this problem, IMAGE_SCN_LNK_NRELOC_OVFL flag of a section
    header has been introduced. If this flag is set for the section,
    then the actual number of relocations is stored in the
    VirtualAddress field of the first relocation.
    
    If the flag is set, then NumberOfRelocations field of the section
    header should be equal to 0xffff, othervice the linker should give
    an error.
    
    So this patch introduces few functions adressing this mechanism.
    
    epep_section_contains_extended_relocations:
    
        Checks whether the section has more than 2^16 - 1 relocations.
        Retrns error if the IMAGE_SCN_LNK_NRELOC_OVFL flag is set, but
        the NumberOfRelocations field is not equal to 0xffff.
    
    epep_get_section_extended_number_of_relocations:
    
        Reads the number of COFF relocations from the VirtualAddress
        field of the first COFF relocation.
    
    epep_get_section_number_of_relocations_x:
    
        Gives the number of meaningful relocations of the section.
    
        If the section has less than 2^16 relocations, then returns the
        value of the NumberOfRelocations field of the section header,
        othervice reads the number of relocations from the first COFF
        relocation, but: since the first relocation in this case is not
        meaningful, gives the actual number of relocations minus one.
        This is used in the function documented below.
    
        Returns 1 in the last argument if the section contains extended
        number of relocations, 0 othervice.
    
    epep_get_section_relocation_by_index_x:
    
        If the section has less than 2^16 relocations, then just reads
        a relocation by the given index. In case if the section has
        extended number of relocations, the first relocation is not
        meaningful, so it is skipped, and the relocation at index + 1
        is read instead.



git-svn-id: svn://kolibrios.org@9927 a494cfbc-eb01-0410-851d-a64ba20cac60
2023-08-06 14:41:09 +00:00
..
bcc32 Neural network perceptron library 2022-03-01 16:10:23 +00:00
cmm drvinst: small bug fixed 2022-12-25 10:16:09 +00:00
demos added feature (which was expected to be) of custom HELPERDIR for some Tupfile's (btw there are still many files with same problem) 2022-04-24 15:05:38 +00:00
develop [clink] Make it able to read and write more than 64k - 1 COFF relocation 2023-08-06 14:41:09 +00:00
emulator DGEN: Fix ksys.h header location 2022-06-15 20:09:08 +00:00
fs KFM - fixed get_inf_dir and delete_dir for some cases 2022-03-30 21:55:55 +00:00
games Samples fix #2 + fridge makefile change 2022-04-06 15:32:56 +00:00
hd_load fix lable name 2022-02-09 22:56:15 +00:00
media
network FTPd: added the DELE and STOR functions, fixed the output code for the new connection 2023-06-08 05:55:41 +00:00
other Upload "mousepos" utility 2023-05-01 11:40:31 +00:00
system AMDtemp: fix parser and code style. TODO: add function for device subsystem 2022-10-16 21:00:24 +00:00
testing KBD: fixing a program crash on unsupported devices 2022-11-26 21:52:16 +00:00
build_all.bat
config.inc
debug-fdo.inc
debug.inc
dll.inc Updated dll.load. Added support for loading the library using the full path. 2023-03-28 16:39:08 +00:00
encoding.inc
export.inc
gui_patterns.inc
import.inc
kglobals.inc
KOSfuncs.inc
load_img.inc
load_lib.mac
macros.inc
network.inc
proc32.inc
shell.inc
string.inc
struct.inc
use_fasm.lua
use_gcc.lua Added defines so as not to duplicate them in every tup file. 2022-02-08 17:38:15 +00:00
use_menuetlibc.lua
use_msvc.lua
use_newlib.lua
use_sdl_newlib.lua
use_sdl.lua
use_sound.lua
use_tcc.lua typo fixed 2022-02-07 14:22:52 +00:00
use_tinygl.lua