<?xml version='1.0' encoding='iso-8859-1' standalone='no'?> <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.4.7"> <compounddef id="ld_8c" kind="file"> <compoundname>ld.c</compoundname> <includes refid="types_8h" local="no">ubixos/types.h</includes> <includes refid="ld_8h" local="no">ubixos/ld.h</includes> <includes refid="sched_8h" local="no">ubixos/sched.h</includes> <includes refid="elf_8h" local="no">ubixos/elf.h</includes> <includes refid="kpanic_8h" local="no">ubixos/kpanic.h</includes> <includes refid="kprintf_8h" local="no">lib/kprintf.h</includes> <includes refid="kmalloc_8h" local="no">lib/kmalloc.h</includes> <includes refid="vfs_8h" local="no">vfs/vfs.h</includes> <includes refid="vmm_8h" local="no">vmm/vmm.h</includes> <includes refid="string_8h" local="no">string.h</includes> <includes refid="assert_8h" local="no">assert.h</includes> <incdepgraph> <node id="5382"> <label>sys/thread.h</label> <link refid="thread_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5384"> <label>ubixos/kpanic.h</label> <link refid="kpanic_8h"/> </node> <node id="5376"> <label>ubixos/sched.h</label> <link refid="sched_8h"/> <childnode refid="5373" relation="include"> </childnode> <childnode refid="5377" relation="include"> </childnode> <childnode refid="5378" relation="include"> </childnode> <childnode refid="5381" relation="include"> </childnode> <childnode refid="5382" relation="include"> </childnode> </node> <node id="5373"> <label>ubixos/types.h</label> <link refid="types_8h"/> <childnode refid="5374" relation="include"> </childnode> </node> <node id="5374"> <label>sys/_types.h</label> <link refid="__types_8h"/> </node> <node id="5391"> <label>vmm/paging.h</label> <link refid="paging_8h"/> <childnode refid="5373" relation="include"> </childnode> <childnode refid="5388" relation="include"> </childnode> <childnode refid="5382" relation="include"> </childnode> </node> <node id="5392"> <label>string.h</label> <link refid="string_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5378"> <label>vfs/file.h</label> <link refid="file_8h"/> <childnode refid="5373" relation="include"> </childnode> <childnode refid="5379" relation="include"> </childnode> <childnode refid="5380" relation="include"> </childnode> </node> <node id="5372"> <label>src/sys/kernel/ld.c</label> <link refid="ld.c"/> <childnode refid="5373" relation="include"> </childnode> <childnode refid="5375" relation="include"> </childnode> <childnode refid="5376" relation="include"> </childnode> <childnode refid="5383" relation="include"> </childnode> <childnode refid="5384" relation="include"> </childnode> <childnode refid="5385" relation="include"> </childnode> <childnode refid="5386" relation="include"> </childnode> <childnode refid="5387" relation="include"> </childnode> <childnode refid="5390" relation="include"> </childnode> <childnode refid="5392" relation="include"> </childnode> <childnode refid="5393" relation="include"> </childnode> </node> <node id="5381"> <label>sys/tss.h</label> <link refid="tss_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5386"> <label>lib/kmalloc.h</label> <link refid="kmalloc_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5390"> <label>vmm/vmm.h</label> <link refid="vmm_8h"/> <childnode refid="5391" relation="include"> </childnode> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5387"> <label>vfs/vfs.h</label> <link refid="vfs_8h"/> <childnode refid="5373" relation="include"> </childnode> <childnode refid="5378" relation="include"> </childnode> <childnode refid="5380" relation="include"> </childnode> <childnode refid="5388" relation="include"> </childnode> <childnode refid="5382" relation="include"> </childnode> </node> <node id="5380"> <label>vfs/mount.h</label> <link refid="mount_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5385"> <label>lib/kprintf.h</label> <link refid="kprintf_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5375"> <label>ubixos/ld.h</label> <link refid="ld_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5393"> <label>assert.h</label> <link refid="assert_8h"/> </node> <node id="5379"> <label>ubixfs/dirCache.h</label> <link refid="dirCache_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5388"> <label>sys/sysproto.h</label> <link refid="sysproto_8h"/> <childnode refid="5389" relation="include"> </childnode> <childnode refid="5382" relation="include"> </childnode> </node> <node id="5383"> <label>ubixos/elf.h</label> <link refid="elf_8h"/> <childnode refid="5373" relation="include"> </childnode> <childnode refid="5376" relation="include"> </childnode> </node> <node id="5389"> <label>sys/signal.h</label> <link refid="signal_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> <node id="5377"> <label>ubixos/tty.h</label> <link refid="tty_8h"/> <childnode refid="5373" relation="include"> </childnode> </node> </incdepgraph> <sectiondef kind="func"> <memberdef kind="function" id="ld_8c_1b0622e93915d1824df770950e425875f" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type><ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref></type> <definition>uInt32 ldEnable</definition> <argsstring>()</argsstring> <name>ldEnable</name> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="/usr/home/reddawg/source/ubix2/src/sys/kernel/ld.c" line="42" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/kernel/ld.c" bodystart="42" bodyend="176"/> <references refid="sched_8h_154397bfe18d5da4d50ff03b15f540858" compoundref="sched_8c" startline="51">_current</references> <references refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" compoundref="assert_8h" startline="64">assert</references> <references refid="structelfHeader_18ff3dd1b27053bc5a2f01afe5403e53b" compoundref="elf_8h" startline="102">elfHeader::eEntry</references> <references refid="elf_8h_18d1ac0f35a8999a4a8a3350ca95ab54b" compoundref="elf_8h" startline="172">ELF32_R_SYM</references> <references refid="elf_8h_1a4ffd69f2c1c03229686bfa3a898db00" compoundref="elf_8h" startline="173">ELF32_R_TYPE</references> <references refid="elf_8h_118371af6e681af62767a92ac64af1ebb" compoundref="elf_8c" startline="107" endline="109">elfGetRelType</references> <references refid="structelfHeader_14635401868104caa04fcb5bb60840df6" compoundref="elf_8h" startline="108">elfHeader::ePhnum</references> <references refid="structelfHeader_1aff1ff2cb64932f1e1a1f6cf3b881787" compoundref="elf_8h" startline="103">elfHeader::ePhoff</references> <references refid="structelfHeader_1a5b9594ecad96ed7448dbcf95da7895f" compoundref="elf_8h" startline="110">elfHeader::eShnum</references> <references refid="structelfHeader_13d8c518903e5e4db018a336edb6ef204" compoundref="elf_8h" startline="104">elfHeader::eShoff</references> <references refid="structelfHeader_18842d2d5aed087cd50914a46461d3f40" compoundref="elf_8h" startline="111">elfHeader::eShstrndx</references> <references refid="file_8h_1872c22366b4c63f4bdb10cd3b7980b11" compoundref="file_8c" startline="398" endline="425">fclose</references> <references refid="file_8h_1d6a41ac88a7d46d574e8a675fdde136c" compoundref="file_8c" startline="274" endline="389">fopen</references> <references refid="file_8h_13b06878a03209e88c008c77234b89359" compoundref="file_8c" startline="178" endline="198">fread</references> <references refid="file_8h_180528d8335cd52755f5d6a92e4f08391" compoundref="file_8c" startline="208" endline="211">fseek</references> <references refid="structtaskStruct_130966587a60db6b40c8be6c387e11d81" compoundref="sched_8h" startline="55">taskStruct::id</references> <references refid="kpanic_8h_1a5193288597f00c4f8e3b2939aa6c0ce" compoundref="kpanic_8h" startline="33">K_PANIC</references> <references refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" compoundref="kmalloc_8c" startline="351" endline="391">kfree</references> <references refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="247" endline="339">kmalloc</references> <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references> <references refid="kmod_8h_1f4d6f389174a00e0de80e1ea0e23e956" compoundref="kmod_8h" startline="35">LD_START</references> <references refid="lib_2string_8h_1ce4b911463887af5e748326323e99a23" compoundref="memset_8c" startline="37" endline="80">memset</references> <references refid="paging_8h_1f0fff7a38cd2c7a32d580787423b94ea" compoundref="paging_8h" startline="52">PAGE_DEFAULT</references> <references refid="structelfProgramHeader_1b5a140ab0f0225a8459f88d905995dd0" compoundref="elf_8h" startline="120">elfProgramHeader::phMemsz</references> <references refid="structelfProgramHeader_114f11176e999131fb9be875aeb500447" compoundref="elf_8h" startline="117">elfProgramHeader::phVaddr</references> <references refid="elf_8h_12121a2f01c51e8462bfd4d47725649d8" compoundref="elf_8h" startline="81">PT_DYNAMIC</references> <references refid="elf_8h_1f9283bc32e6d3e87d2bab2f55bc1949b" compoundref="elf_8h" startline="91">PT_GNU_STACK</references> <references refid="elf_8h_184d7768fd6c6ece599d297090900cf92" compoundref="elf_8h" startline="80">PT_LOAD</references> <references refid="elf_8h_17294b5e14e1cf5becf35236381698f48" compoundref="elf_8h" startline="93">PT_PAX_FLAGS</references> <references refid="elf_8h_1f363b787459afd7e272677d7858572c0" compoundref="elf_8h" startline="40">R_386_32</references> <references refid="elf_8h_1d55eb4ccb6e52c4c03f99b34cc8c690b" compoundref="elf_8h" startline="41">R_386_PC32</references> <references refid="elf_8h_1ee5190154984e6176e1c6804ac13217d" compoundref="elf_8h" startline="47">R_386_RELATIVE</references> <references refid="structelfSectionHeader_1285d41cc0ad6e460792b9524c6db5345" compoundref="elf_8h" startline="131">elfSectionHeader::shSize</references> <references refid="lib_2string_8h_16f3dcb20ff11ff9db5904c3cfb61a38c" compoundref="string_8c" startline="32" endline="46">strcmp</references> <references refid="paging_8h_1a05f8d8947fb5bcec87fc6661f83243e" compoundref="paging_8c" startline="160" endline="241">vmm_remapPage</references> <references refid="vmm_8h_1976cf3919bf7c77c868021ec9374593b" compoundref="vmm__memory_8c" startline="186" endline="216">vmmFindFreePage</references> <references refid="ap-boot_8S_1f78b91f02427adef14bb8b28aa93baa5" compoundref="ap-boot_8S" startline="52">x1000</references> <referencedby refid="exec_8c_1219681612352232186a0f568457d851d" compoundref="exec_8c" startline="334" endline="546">sysExec</referencedby> </memberdef> </sectiondef> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <programlisting> <codeline lineno="1"><highlight class="comment">/*****************************************************************************************</highlight></codeline> <codeline lineno="2"><highlight class="comment"><sp/>Copyright<sp/>(c)<sp/>2002-2004<sp/>The<sp/>UbixOS<sp/>Project</highlight></codeline> <codeline lineno="3"><highlight class="comment"><sp/>All<sp/>rights<sp/>reserved.</highlight></codeline> <codeline lineno="4"><highlight class="comment"></highlight></codeline> <codeline lineno="5"><highlight class="comment"><sp/>Redistribution<sp/>and<sp/>use<sp/>in<sp/>source<sp/>and<sp/>binary<sp/>forms,<sp/>with<sp/>or<sp/>without<sp/>modification,<sp/>are</highlight></codeline> <codeline lineno="6"><highlight class="comment"><sp/>permitted<sp/>provided<sp/>that<sp/>the<sp/>following<sp/>conditions<sp/>are<sp/>met:</highlight></codeline> <codeline lineno="7"><highlight class="comment"></highlight></codeline> <codeline lineno="8"><highlight class="comment"><sp/>Redistributions<sp/>of<sp/>source<sp/>code<sp/>must<sp/>retain<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of</highlight></codeline> <codeline lineno="9"><highlight class="comment"><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors.<sp/><sp/>Redistributions<sp/>in<sp/>binary</highlight></codeline> <codeline lineno="10"><highlight class="comment"><sp/>form<sp/>must<sp/>reproduce<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of<sp/>conditions,<sp/>the<sp/>following</highlight></codeline> <codeline lineno="11"><highlight class="comment"><sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors<sp/>in<sp/>the<sp/>documentation<sp/>and/or<sp/>other<sp/>materials<sp/>provided</highlight></codeline> <codeline lineno="12"><highlight class="comment"><sp/>with<sp/>the<sp/>distribution.<sp/>Neither<sp/>the<sp/>name<sp/>of<sp/>the<sp/>UbixOS<sp/>Project<sp/>nor<sp/>the<sp/>names<sp/>of<sp/>its</highlight></codeline> <codeline lineno="13"><highlight class="comment"><sp/>contributors<sp/>may<sp/>be<sp/>used<sp/>to<sp/>endorse<sp/>or<sp/>promote<sp/>products<sp/>derived<sp/>from<sp/>this<sp/>software</highlight></codeline> <codeline lineno="14"><highlight class="comment"><sp/>without<sp/>specific<sp/>prior<sp/>written<sp/>permission.</highlight></codeline> <codeline lineno="15"><highlight class="comment"></highlight></codeline> <codeline lineno="16"><highlight class="comment"><sp/>THIS<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>BY<sp/>THE<sp/>COPYRIGHT<sp/>HOLDERS<sp/>AND<sp/>CONTRIBUTORS<sp/>"AS<sp/>IS"<sp/>AND<sp/>ANY</highlight></codeline> <codeline lineno="17"><highlight class="comment"><sp/>EXPRESS<sp/>OR<sp/>IMPLIED<sp/>WARRANTIES,<sp/>INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>THE<sp/>IMPLIED<sp/>WARRANTIES<sp/>OF</highlight></codeline> <codeline lineno="18"><highlight class="comment"><sp/>MERCHANTABILITY<sp/>AND<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>ARE<sp/>DISCLAIMED.<sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL</highlight></codeline> <codeline lineno="19"><highlight class="comment"><sp/>THE<sp/>COPYRIGHT<sp/>OWNER<sp/>OR<sp/>CONTRIBUTORS<sp/>BE<sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>DIRECT,<sp/>INDIRECT,<sp/>INCIDENTAL,</highlight></codeline> <codeline lineno="20"><highlight class="comment"><sp/>SPECIAL,<sp/>EXEMPLARY,<sp/>OR<sp/>CONSEQUENTIAL<sp/>DAMAGES<sp/>(INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>PROCUREMENT</highlight></codeline> <codeline lineno="21"><highlight class="comment"><sp/>OF<sp/>SUBSTITUTE<sp/>GOODS<sp/>OR<sp/>SERVICES;<sp/>LOSS<sp/>OF<sp/>USE,<sp/>DATA,<sp/>OR<sp/>PROFITS;<sp/>OR<sp/>BUSINESS<sp/>INTERRUPTION)</highlight></codeline> <codeline lineno="22"><highlight class="comment"><sp/>HOWEVER<sp/>CAUSED<sp/>AND<sp/>ON<sp/>ANY<sp/>THEORY<sp/>OF<sp/>LIABILITY,<sp/>WHETHER<sp/>IN<sp/>CONTRACT,<sp/>STRICT<sp/>LIABILITY,<sp/>OR</highlight></codeline> <codeline lineno="23"><highlight class="comment"><sp/>TORT<sp/>(INCLUDING<sp/>NEGLIGENCE<sp/>OR<sp/>OTHERWISE)<sp/>ARISING<sp/>IN<sp/>ANY<sp/>WAY<sp/>OUT<sp/>OF<sp/>THE<sp/>USE<sp/>OF<sp/>THIS</highlight></codeline> <codeline lineno="24"><highlight class="comment"><sp/>SOFTWARE,<sp/>EVEN<sp/>IF<sp/>ADVISED<sp/>OF<sp/>THE<sp/>POSSIBILITY<sp/>OF<sp/>SUCH<sp/>DAMAGE.</highlight></codeline> <codeline lineno="25"><highlight class="comment"></highlight></codeline> <codeline lineno="26"><highlight class="comment"><sp/>$Id: ld_8c.xml 88 2016-01-12 00:11:29Z reddawg $</highlight></codeline> <codeline lineno="27"><highlight class="comment"></highlight></codeline> <codeline lineno="28"><highlight class="comment">*****************************************************************************************/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="29"><highlight class="normal"></highlight></codeline> <codeline lineno="30"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="types_8h" kindref="compound">ubixos/types.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="31"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="ld_8h" kindref="compound">ubixos/ld.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="sched_8h" kindref="compound">ubixos/sched.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="33"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="elf_8h" kindref="compound">ubixos/elf.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="34"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="kpanic_8h" kindref="compound">ubixos/kpanic.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="35"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="kprintf_8h" kindref="compound">lib/kprintf.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="36"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="kmalloc_8h" kindref="compound">lib/kmalloc.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="37"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="vfs_8h" kindref="compound">vfs/vfs.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="38"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="vmm_8h" kindref="compound">vmm/vmm.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="39"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="string_8h" kindref="compound">string.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="40"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="assert_8h" kindref="compound">assert.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="41"><highlight class="normal"></highlight></codeline> <codeline lineno="42" refid="ld_8c_1b0622e93915d1824df770950e425875f" refkind="member"><highlight class="normal"><ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref><sp/><ref refid="ld_8h_1b0622e93915d1824df770950e425875f" kindref="member">ldEnable</ref>()<sp/>{</highlight></codeline> <codeline lineno="43"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="44"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="45"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rel<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="46"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sym<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="47"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*newLoc<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;<sp/></highlight></codeline> <codeline lineno="48"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*shStr<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="49"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*dynStr<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="50"><highlight class="normal"><sp/><sp/><ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*reMap<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="51"><highlight class="normal"><sp/><sp/><ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref><sp/><sp/><sp/>*ldFd<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="52"><highlight class="normal"><sp/><sp/><ref refid="structelfHeader" kindref="compound">elfHeader</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*binaryHeader<sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="53"><highlight class="normal"><sp/><sp/><ref refid="structelfProgramHeader" kindref="compound">elfProgramHeader</ref><sp/>*programHeader<sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="54"><highlight class="normal"><sp/><sp/><ref refid="structelfSectionHeader" kindref="compound">elfSectionHeader</ref><sp/>*sectionHeader<sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="55"><highlight class="normal"><sp/><sp/><ref refid="structelfDynSym" kindref="compound">elfDynSym</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*relSymTab<sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="56"><highlight class="normal"><sp/><sp/><ref refid="structelfPltInfo" kindref="compound">elfPltInfo</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*elfRel<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="57"><highlight class="normal"></highlight></codeline> <codeline lineno="58"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Open<sp/>our<sp/>dynamic<sp/>linker<sp/>*/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="59"><highlight class="normal"><sp/><sp/>ldFd<sp/>=<sp/><ref refid="file_8h_1d6a41ac88a7d46d574e8a675fdde136c" kindref="member">fopen</ref>(</highlight><highlight class="stringliteral">"sys:/lib/ld.so"</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">"rb"</highlight><highlight class="normal">);</highlight></codeline> <codeline lineno="60"><highlight class="normal"></highlight></codeline> <codeline lineno="61"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ldFd<sp/>==<sp/>0x0)<sp/>{</highlight></codeline> <codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">"Can<sp/>not<sp/>open<sp/>ld.so\n"</highlight><highlight class="normal">);</highlight></codeline> <codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline> <codeline lineno="64"><highlight class="normal"><sp/></highlight></codeline> <codeline lineno="65"><highlight class="normal"><sp/><sp/><ref refid="file_8h_180528d8335cd52755f5d6a92e4f08391" kindref="member">fseek</ref>(ldFd,0x0,0x0);</highlight></codeline> <codeline lineno="66"><highlight class="normal"><sp/><sp/>binaryHeader<sp/>=<sp/>(<ref refid="structelfHeader" kindref="compound">elfHeader</ref><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structelfHeader" kindref="compound">elfHeader</ref>));</highlight></codeline> <codeline lineno="67"><highlight class="normal"><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(binaryHeader);</highlight></codeline> <codeline lineno="68"><highlight class="normal"><sp/><sp/><ref refid="file_8h_13b06878a03209e88c008c77234b89359" kindref="member">fread</ref>(binaryHeader,</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(elfHeader),1,ldFd);</highlight></codeline> <codeline lineno="69"><highlight class="normal"></highlight></codeline> <codeline lineno="70"><highlight class="normal"><sp/><sp/>programHeader<sp/>=<sp/>(<ref refid="structelfProgramHeader" kindref="compound">elfProgramHeader</ref><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structelfProgramHeader" kindref="compound">elfProgramHeader</ref>)*binaryHeader-><ref refid="structelfHeader_14635401868104caa04fcb5bb60840df6" kindref="member">ePhnum</ref>);</highlight></codeline> <codeline lineno="71"><highlight class="normal"><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(programHeader);</highlight></codeline> <codeline lineno="72"><highlight class="normal"><sp/><sp/><ref refid="file_8h_180528d8335cd52755f5d6a92e4f08391" kindref="member">fseek</ref>(ldFd,binaryHeader-><ref refid="structelfHeader_1aff1ff2cb64932f1e1a1f6cf3b881787" kindref="member">ePhoff</ref>,0);</highlight></codeline> <codeline lineno="73"><highlight class="normal"><sp/><sp/><ref refid="file_8h_13b06878a03209e88c008c77234b89359" kindref="member">fread</ref>(programHeader,</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structelfSectionHeader" kindref="compound">elfSectionHeader</ref>),binaryHeader-><ref refid="structelfHeader_14635401868104caa04fcb5bb60840df6" kindref="member">ePhnum</ref>,ldFd);</highlight></codeline> <codeline lineno="74"><highlight class="normal"></highlight></codeline> <codeline lineno="75"><highlight class="normal"><sp/><sp/>sectionHeader<sp/>=<sp/>(elfSectionHeader<sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(elfSectionHeader)*binaryHeader-><ref refid="structelfHeader_1a5b9594ecad96ed7448dbcf95da7895f" kindref="member">eShnum</ref>);</highlight></codeline> <codeline lineno="76"><highlight class="normal"><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(sectionHeader);</highlight></codeline> <codeline lineno="77"><highlight class="normal"><sp/><sp/><ref refid="file_8h_180528d8335cd52755f5d6a92e4f08391" kindref="member">fseek</ref>(ldFd,binaryHeader-><ref refid="structelfHeader_13d8c518903e5e4db018a336edb6ef204" kindref="member">eShoff</ref>,0);</highlight></codeline> <codeline lineno="78"><highlight class="normal"><sp/><sp/><ref refid="file_8h_13b06878a03209e88c008c77234b89359" kindref="member">fread</ref>(sectionHeader,</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(elfSectionHeader),binaryHeader-><ref refid="structelfHeader_1a5b9594ecad96ed7448dbcf95da7895f" kindref="member">eShnum</ref>,ldFd);</highlight></codeline> <codeline lineno="79"><highlight class="normal"></highlight></codeline> <codeline lineno="80"><highlight class="normal"><sp/><sp/>shStr<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(sectionHeader[binaryHeader-><ref refid="structelfHeader_18842d2d5aed087cd50914a46461d3f40" kindref="member">eShstrndx</ref>].shSize);</highlight></codeline> <codeline lineno="81"><highlight class="normal"><sp/><sp/><ref refid="file_8h_180528d8335cd52755f5d6a92e4f08391" kindref="member">fseek</ref>(ldFd,sectionHeader[binaryHeader-><ref refid="structelfHeader_18842d2d5aed087cd50914a46461d3f40" kindref="member">eShstrndx</ref>].shOffset,0);</highlight></codeline> <codeline lineno="82"><highlight class="normal"><sp/><sp/><ref refid="file_8h_13b06878a03209e88c008c77234b89359" kindref="member">fread</ref>(shStr,sectionHeader[binaryHeader-><ref refid="structelfHeader_18842d2d5aed087cd50914a46461d3f40" kindref="member">eShstrndx</ref>].shSize,1,ldFd);</highlight></codeline> <codeline lineno="83"><highlight class="normal"></highlight></codeline> <codeline lineno="84"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0x0;i<sp/><<sp/>binaryHeader-><ref refid="structelfHeader_14635401868104caa04fcb5bb60840df6" kindref="member">ePhnum</ref>;i++)<sp/>{</highlight></codeline> <codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(programHeader[i].phType)<sp/>{</highlight></codeline> <codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="elf_8h_184d7768fd6c6ece599d297090900cf92" kindref="member">PT_LOAD</ref>:</highlight></codeline> <codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>newLoc<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)programHeader[i].phVaddr<sp/>+<sp/><ref refid="kmod_8h_1f4d6f389174a00e0de80e1ea0e23e956" kindref="member">LD_START</ref>;</highlight></codeline> <codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline> <codeline lineno="89"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Allocate<sp/>Memory<sp/>Im<sp/>Going<sp/>To<sp/>Have<sp/>To<sp/>Make<sp/>This<sp/>Load<sp/>Memory<sp/>With<sp/>Correct</highlight></codeline> <codeline lineno="90"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Settings<sp/>so<sp/>it<sp/>helps<sp/>us<sp/>in<sp/>the<sp/>future</highlight></codeline> <codeline lineno="91"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(x=0;x<sp/><<sp/>(programHeader[i].<ref refid="structelfProgramHeader_1b5a140ab0f0225a8459f88d905995dd0" kindref="member">phMemsz</ref>);x<sp/>+=<sp/>0x1000)<sp/>{</highlight></codeline> <codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>make<sp/>r/w<sp/>or<sp/>ro<sp/>*/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="paging_8h_1a05f8d8947fb5bcec87fc6661f83243e" kindref="member">vmm_remapPage</ref>(<ref refid="vmm_8h_1976cf3919bf7c77c868021ec9374593b" kindref="member">vmmFindFreePage</ref>(<ref refid="sched_8h_154397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-><ref refid="structtaskStruct_130966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>),((programHeader[i].<ref refid="structelfProgramHeader_114f11176e999131fb9be875aeb500447" kindref="member">phVaddr</ref><sp/>&<sp/>0xFFFFF000)<sp/>+<sp/>x<sp/>+<sp/><ref refid="kmod_8h_1f4d6f389174a00e0de80e1ea0e23e956" kindref="member">LD_START</ref>),<ref refid="paging_8h_1f0fff7a38cd2c7a32d580787423b94ea" kindref="member">PAGE_DEFAULT</ref>))<sp/>==<sp/>0x0)<sp/></highlight></codeline> <codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1a5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">"vmmRemapPage:<sp/>ld"</highlight><highlight class="normal">);</highlight></codeline> <codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="lib_2string_8h_1ce4b911463887af5e748326323e99a23" kindref="member">memset</ref>((</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)((programHeader[i].phVaddr<sp/>&<sp/>0xFFFFF000)<sp/>+<sp/>x<sp/>+<sp/><ref refid="kmod_8h_1f4d6f389174a00e0de80e1ea0e23e956" kindref="member">LD_START</ref>),0x0,0<ref refid="ap-boot_8S_1f78b91f02427adef14bb8b28aa93baa5" kindref="member">x1000</ref>);</highlight></codeline> <codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> <codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Now<sp/>Load<sp/>Section<sp/>To<sp/>Memory<sp/>*/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_180528d8335cd52755f5d6a92e4f08391" kindref="member">fseek</ref>(ldFd,programHeader[i].phOffset,0x0);</highlight></codeline> <codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_13b06878a03209e88c008c77234b89359" kindref="member">fread</ref>(newLoc,programHeader[i].phFilesz,1,ldFd);</highlight></codeline> <codeline lineno="101"><highlight class="normal"></highlight></codeline> <codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="elf_8h_12121a2f01c51e8462bfd4d47725649d8" kindref="member">PT_DYNAMIC</ref>:</highlight></codeline> <codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Now<sp/>Load<sp/>Section<sp/>To<sp/>Memory<sp/>*/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_180528d8335cd52755f5d6a92e4f08391" kindref="member">fseek</ref>(ldFd,programHeader[i].phOffset,0x0);</highlight></codeline> <codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_13b06878a03209e88c008c77234b89359" kindref="member">fread</ref>(newLoc,programHeader[i].phFilesz,1,ldFd);</highlight></codeline> <codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="elf_8h_1f9283bc32e6d3e87d2bab2f55bc1949b" kindref="member">PT_GNU_STACK</ref>:</highlight></codeline> <codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Tells<sp/>us<sp/>if<sp/>the<sp/>stack<sp/>should<sp/>be<sp/>executable.<sp/><sp/>Failsafe<sp/>to<sp/>executable</highlight></codeline> <codeline lineno="110"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>until<sp/>we<sp/>add<sp/>checking<sp/>*/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="elf_8h_17294b5e14e1cf5becf35236381698f48" kindref="member">PT_PAX_FLAGS</ref>:</highlight></codeline> <codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Not<sp/>sure...<sp/>*/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline> <codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">"Unhandled<sp/>Header<sp/>(kernel)<sp/>:<sp/>%08x\n"</highlight><highlight class="normal">,<sp/>programHeader[i].phType);</highlight></codeline> <codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> <codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline> <codeline lineno="120"><highlight class="normal"></highlight></codeline> <codeline lineno="121"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0x0;i<binaryHeader-><ref refid="structelfHeader_1a5b9594ecad96ed7448dbcf95da7895f" kindref="member">eShnum</ref>;i++)<sp/>{</highlight></codeline> <codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(sectionHeader[i].shType)<sp/>{</highlight></codeline> <codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>3:</highlight></codeline> <codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="lib_2string_8h_16f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>((shStr<sp/>+<sp/>sectionHeader[i].shName),</highlight><highlight class="stringliteral">".dynstr"</highlight><highlight class="normal">))<sp/>{</highlight></codeline> <codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dynStr<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(sectionHeader[i].shSize);</highlight></codeline> <codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_180528d8335cd52755f5d6a92e4f08391" kindref="member">fseek</ref>(ldFd,sectionHeader[i].shOffset,0x0);</highlight></codeline> <codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_13b06878a03209e88c008c77234b89359" kindref="member">fread</ref>(dynStr,sectionHeader[i].shSize,1,ldFd);</highlight></codeline> <codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> <codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>9:</highlight></codeline> <codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>elfRel<sp/>=<sp/>(<ref refid="structelfPltInfo" kindref="compound">elfPltInfo</ref><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(sectionHeader[i].shSize);</highlight></codeline> <codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_180528d8335cd52755f5d6a92e4f08391" kindref="member">fseek</ref>(ldFd,sectionHeader[i].shOffset,0x0);</highlight></codeline> <codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_13b06878a03209e88c008c77234b89359" kindref="member">fread</ref>(elfRel,sectionHeader[i].shSize,1,ldFd);</highlight></codeline> <codeline lineno="134"><highlight class="normal"></highlight></codeline> <codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(x=0x0;x<sectionHeader[i].<ref refid="structelfSectionHeader_1285d41cc0ad6e460792b9524c6db5345" kindref="member">shSize</ref>/</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structelfPltInfo" kindref="compound">elfPltInfo</ref>);x++)<sp/>{</highlight></codeline> <codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rel<sp/>=<sp/><ref refid="elf_8h_18d1ac0f35a8999a4a8a3350ca95ab54b" kindref="member">ELF32_R_SYM</ref>(elfRel[x].pltInfo);</highlight></codeline> <codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>reMap<sp/>=<sp/>(<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref><sp/>*)((<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)<ref refid="kmod_8h_1f4d6f389174a00e0de80e1ea0e23e956" kindref="member">LD_START</ref><sp/>+<sp/>elfRel[x].pltOffset);</highlight></codeline> <codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(<ref refid="elf_8h_1a4ffd69f2c1c03229686bfa3a898db00" kindref="member">ELF32_R_TYPE</ref>(elfRel[x].pltInfo))<sp/>{</highlight></codeline> <codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="elf_8h_1f363b787459afd7e272677d7858572c0" kindref="member">R_386_32</ref>:</highlight></codeline> <codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*reMap<sp/>+=<sp/>((<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)<ref refid="kmod_8h_1f4d6f389174a00e0de80e1ea0e23e956" kindref="member">LD_START</ref><sp/>+<sp/>relSymTab[rel].dynValue);</highlight></codeline> <codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="elf_8h_1d55eb4ccb6e52c4c03f99b34cc8c690b" kindref="member">R_386_PC32</ref>:</highlight></codeline> <codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*reMap<sp/>+=<sp/>((<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)<ref refid="kmod_8h_1f4d6f389174a00e0de80e1ea0e23e956" kindref="member">LD_START</ref><sp/>+<sp/>relSymTab[rel].dynValue)<sp/>-<sp/>(<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)reMap;</highlight></codeline> <codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="elf_8h_1ee5190154984e6176e1c6804ac13217d" kindref="member">R_386_RELATIVE</ref>:</highlight></codeline> <codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*reMap<sp/>+=<sp/>(<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)<ref refid="kmod_8h_1f4d6f389174a00e0de80e1ea0e23e956" kindref="member">LD_START</ref>;</highlight></codeline> <codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline> <codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">"[0x%X][0x%X](%i)[%s]\n"</highlight><highlight class="normal">,elfRel[x].pltOffset,elfRel[x].pltInfo,rel,<ref refid="elf_8h_118371af6e681af62767a92ac64af1ebb" kindref="member">elfGetRelType</ref>(<ref refid="elf_8h_1a4ffd69f2c1c03229686bfa3a898db00" kindref="member">ELF32_R_TYPE</ref>(elfRel[x].pltInfo)));</highlight></codeline> <codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">"relTab<sp/>[%s][0x%X][0x%X]\n"</highlight><highlight class="normal">,dynStr<sp/>+<sp/>relSymTab[rel].dynName,relSymTab[rel].dynValue,relSymTab[rel].dynName);</highlight></codeline> <codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> <codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> <codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(elfRel);</highlight></codeline> <codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>11:</highlight></codeline> <codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>relSymTab<sp/>=<sp/>(<ref refid="structelfDynSym" kindref="compound">elfDynSym</ref><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(sectionHeader[i].shSize);</highlight></codeline> <codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_180528d8335cd52755f5d6a92e4f08391" kindref="member">fseek</ref>(ldFd,sectionHeader[i].shOffset,0x0);</highlight></codeline> <codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="file_8h_13b06878a03209e88c008c77234b89359" kindref="member">fread</ref>(relSymTab,sectionHeader[i].shSize,1,ldFd);</highlight></codeline> <codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sym<sp/>=<sp/>i;</highlight></codeline> <codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> <codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline> <codeline lineno="164"><highlight class="normal"></highlight></codeline> <codeline lineno="165"><highlight class="normal"><sp/><sp/>i<sp/>=<sp/>binaryHeader-><ref refid="structelfHeader_18ff3dd1b27053bc5a2f01afe5403e53b" kindref="member">eEntry</ref><sp/>+<sp/><ref refid="kmod_8h_1f4d6f389174a00e0de80e1ea0e23e956" kindref="member">LD_START</ref>;</highlight></codeline> <codeline lineno="166"><highlight class="normal"></highlight></codeline> <codeline lineno="167"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(dynStr);</highlight></codeline> <codeline lineno="168"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(shStr);</highlight></codeline> <codeline lineno="169"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(relSymTab);</highlight></codeline> <codeline lineno="170"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(sectionHeader);</highlight></codeline> <codeline lineno="171"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(programHeader);</highlight></codeline> <codeline lineno="172"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(binaryHeader);</highlight></codeline> <codeline lineno="173"><highlight class="normal"><sp/><sp/><ref refid="file_8h_1872c22366b4c63f4bdb10cd3b7980b11" kindref="member">fclose</ref>(ldFd);</highlight></codeline> <codeline lineno="174"><highlight class="normal"></highlight></codeline> <codeline lineno="175"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">((<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)i);</highlight></codeline> <codeline lineno="176"><highlight class="normal"><sp/><sp/>}</highlight></codeline> <codeline lineno="177"><highlight class="normal"></highlight></codeline> <codeline lineno="178"><highlight class="normal"></highlight><highlight class="comment">/***</highlight></codeline> <codeline lineno="179"><highlight class="comment"><sp/>END</highlight></codeline> <codeline lineno="180"><highlight class="comment"><sp/>***/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="181"><highlight class="normal"></highlight></codeline> </programlisting> <location file="/usr/home/reddawg/source/ubix2/src/sys/kernel/ld.c"/> </compounddef> </doxygen>