summaryrefslogtreecommitdiffstats
path: root/src/core/loader/elf.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-08-01core/loader: remove ELF loaderLiam1-263/+0
2022-06-05common: consolidate ELF structure definitionsLiam1-167/+16
2022-04-28chore: add missing SPDX tagsAndrea Pappacoda1-3/+3
Follow-up to 99ceb03a1cfcf35968cab589ea188a8c406cda52
2021-11-04core: Remove unused includesameerj1-1/+0
2021-05-26common: fs: Rework the Common Filesystem interface to make use of std::filesystem (#6270)Morph1-1/+0
* common: fs: fs_types: Create filesystem types Contains various filesystem types used by the Common::FS library * common: fs: fs_util: Add std::string to std::u8string conversion utility * common: fs: path_util: Add utlity functions for paths Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library * common: fs: file: Rewrite the IOFile implementation * common: fs: Reimplement Common::FS library using std::filesystem * common: fs: fs_paths: Add fs_paths to replace common_paths * common: fs: path_util: Add the rest of the path functions * common: Remove the previous Common::FS implementation * general: Remove unused fs includes * string_util: Remove unused function and include * nvidia_flags: Migrate to the new Common::FS library * settings: Migrate to the new Common::FS library * logging: backend: Migrate to the new Common::FS library * core: Migrate to the new Common::FS library * perf_stats: Migrate to the new Common::FS library * reporter: Migrate to the new Common::FS library * telemetry_session: Migrate to the new Common::FS library * key_manager: Migrate to the new Common::FS library * bis_factory: Migrate to the new Common::FS library * registered_cache: Migrate to the new Common::FS library * xts_archive: Migrate to the new Common::FS library * service: acc: Migrate to the new Common::FS library * applets/profile: Migrate to the new Common::FS library * applets/web: Migrate to the new Common::FS library * service: filesystem: Migrate to the new Common::FS library * loader: Migrate to the new Common::FS library * gl_shader_disk_cache: Migrate to the new Common::FS library * nsight_aftermath_tracker: Migrate to the new Common::FS library * vulkan_library: Migrate to the new Common::FS library * configure_debug: Migrate to the new Common::FS library * game_list_worker: Migrate to the new Common::FS library * config: Migrate to the new Common::FS library * configure_filesystem: Migrate to the new Common::FS library * configure_per_game_addons: Migrate to the new Common::FS library * configure_profile_manager: Migrate to the new Common::FS library * configure_ui: Migrate to the new Common::FS library * input_profiles: Migrate to the new Common::FS library * yuzu_cmd: config: Migrate to the new Common::FS library * yuzu_cmd: Migrate to the new Common::FS library * vfs_real: Migrate to the new Common::FS library * vfs: Migrate to the new Common::FS library * vfs_libzip: Migrate to the new Common::FS library * service: bcat: Migrate to the new Common::FS library * yuzu: main: Migrate to the new Common::FS library * vfs_real: Delete the contents of an existing file in CreateFile Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now. * input_profiles: Don't iterate the input profile dir if it does not exist Silences an error produced in the log if the directory does not exist. * game_list_worker: Skip parsing file if the returned VfsFile is nullptr Prevents crashes in GetLoader when the virtual file is nullptr * common: fs: Validate paths for path length * service: filesystem: Open the mod load directory as read only
2021-05-06hle: kernel: Rename Process to KProcess.bunnei1-2/+2
2021-04-27loader: Resolve instances of variable shadowingLioncash1-5/+8
Eliminates variable shadowing cases across all the loaders to bring us closer to enabling variable shadowing as an error in core.
2021-02-19hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable.bunnei1-1/+1
2020-10-21Revert "core: Fix clang build"bunnei1-18/+17
2020-10-18core: Fix clang buildLioncash1-17/+18
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
2020-09-16core/loader: Remove dependencies on the global system instanceLioncash1-1/+2
Now all that remains is: 18 instances in file_sys code 14 instances in GDB stub code (this can be tossed wholesale) 4 instances in HLE code 2 instances in settings code.
2020-04-21loader: elf: Fix process initialization using ProgramMetadata default.bunnei1-0/+5
2020-04-17loader: elf/kip/nro: Updates for new VMM.bunnei1-2/+2
2020-04-17core: memory: Move to Core::Memory namespace.bunnei1-1/+1
- helpful to disambiguate Kernel::Memory namespace.
2020-01-18core/loaders: Simplify PhysicalMemory usage.Markus Wick1-1/+2
It is currently a std::vector, however we might want to replace it with a more fancy allocator. So we can't use the C++ iterators any more.
2019-07-19VM_Manager: Align allocated memory to 256bytesFernando Sahmkow1-1/+1
This commit ensures that all backing memory allocated for the Guest CPU is aligned to 256 bytes. This due to how gpu memory works and the heavy constraints it has in the alignment of physical memory.
2019-04-12core/core: Move process execution start to System's Load()Lioncash1-7/+8
This gives us significantly more control over where in the initialization process we start execution of the main process. Previously we were running the main process before the CPU or GPU threads were initialized (not good). This amends execution to start after all of our threads are properly set up.
2019-03-22kernel/codeset: Make CodeSet's memory data member a regular std::vectorLioncash1-1/+1
The use of a shared_ptr is an implementation detail of the VMManager itself when mapping memory. Because of that, we shouldn't require all users of the CodeSet to have to allocate the shared_ptr ahead of time. It's intended that CodeSet simply pass in the required direct data, and that the memory manager takes care of it from that point on. This means we just do the shared pointer allocation in a single place, when loading modules, as opposed to in each loader.
2019-03-20kernel: Move CodeSet structure to its own source filesLioncash1-0/+1
Given this is utilized by the loaders, this allows avoiding inclusion of the kernel process definitions where avoidable. This also keeps the loading format for all executable data separate from the kernel objects.
2018-10-12kernel/process: Make CodeSet a regular non-inherited objectLioncash1-19/+13
These only exist to ferry data into a Process instance and end up going out of scope quite early. Because of this, we can just make it a plain struct for holding things and just std::move it into the relevant function. There's no need to make this inherit from the kernel's Object type.
2018-09-30kernel/process: Make data member variables privateLioncash1-1/+1
Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code.
2018-09-29loader: Make the Load() function take a process as a regular reference, not a SharedPtrLioncash1-4/+4
A process should never require being reference counted in this situation. If the handle to a process is freed before this function is called, it's definitely a bug with our lifetime management, so we can put the requirement in place for the API that the process must be a valid instance.
2018-09-25memory: Dehardcode the use of fixed memory range constantsLioncash1-11/+13
The locations of these can actually vary depending on the address space layout, so we shouldn't be using these when determining where to map memory or be using them as offsets for calculations. This keeps all the memory ranges flexible and malleable based off of the virtual memory manager instance state.
2018-09-24process/vm_manager: Amend API to allow reading parameters from NPDM metadataLioncash1-8/+0
Rather than hard-code the address range to be 36-bit, we can derive the parameters from supplied NPDM metadata if the supplied exectuable supports it. This is the bare minimum necessary for this to be possible. The following commits will rework the memory code further to adjust to this.
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi1-1/+1
2018-08-31core/core: Replace includes with forward declarations where applicableLioncash1-0/+1
The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, which replaces most of the includes in the core header with forward declarations. This makes it so that if any of the headers the core header was previously including change, then no one will need to rebuild the bulk of the core, due to core.h being quite a prevalent inclusion. This should make turnaround for changes much faster for developers.
2018-08-29kernel: Eliminate kernel global stateLioncash1-2/+5
As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
2018-08-15loader: Remove address mapping remnants from citraLioncash1-1/+0
These mappings are leftovers from citra and don't apply to the Switch.
2018-08-10loader: Add more descriptive errorsZach Hilman1-1/+1
Full list of new errors and descriptions in core/loader/loader.h
2018-08-03kernel/process: Use accessors instead of class members for referencing segment arrayLioncash1-3/+3
Using member variables for referencing the segments array increases the size of the class in memory for little benefit. The same behavior can be achieved through the use of accessors that just return the relevant segment.
2018-07-24core: Make converting constructors explicit where applicableLioncash1-1/+1
Avoids unwanted implicit conversions. Thankfully, given the large amount of cleanup in past PRs, only this tiny amount is left over to cover.
2018-07-19Virtual Filesystem 2: Electric Boogaloo (#676)Zach Hilman1-17/+7
* Virtual Filesystem * Fix delete bug and documentate * Review fixes + other stuff * Fix puyo regression
2018-07-08Revert "Virtual Filesystem (#597)"bunnei1-7/+17
This reverts commit 77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.
2018-07-06Virtual Filesystem (#597)Zach Hilman1-17/+7
* Add VfsFile and VfsDirectory classes * Finish abstract Vfs classes * Implement RealVfsFile (computer fs backend) * Finish RealVfsFile and RealVfsDirectory * Finished OffsetVfsFile * More changes * Fix import paths * Major refactor * Remove double const * Use experimental/filesystem or filesystem depending on compiler * Port partition_filesystem * More changes * More Overhaul * FSP_SRV fixes * Fixes and testing * Try to get filesystem to compile * Filesystem on linux * Remove std::filesystem and document/test * Compile fixes * Missing include * Bug fixes * Fixes * Rename v_file and v_dir * clang-format fix * Rename NGLOG_* to LOG_* * Most review changes * Fix TODO * Guess 'main' to be Directory by filename
2018-07-03Update clang formatJames Rowe1-5/+5
2018-07-03Rename logging macro back to LOG_*James Rowe1-8/+8
2018-04-25loader: Move old logging macros over to new fmt-capable onesLioncash1-13/+13
2018-03-31memory: Fix stack region.bunnei1-1/+1
2018-03-16kernel: Move stack region outside of application heap.bunnei1-1/+1
2018-03-14core: Move process creation out of global state.bunnei1-1/+0
2018-03-02Kernel: Store the program id in the Process class instead of the CodeSet class.Subv1-2/+2
There may be many CodeSets per Process, so it's wasteful and overcomplicated to store the program id in each of them.
2018-01-21Format: Run the new clang format on everythingJames Rowe1-2/+3
2018-01-20loader: Clean up ctors and includes.bunnei1-0/+3
2018-01-20loader: Refactor to also pass filepath into IdentifyType.bunnei1-1/+1
2017-10-15core: Refactor MakeMagic usage and remove dead code.bunnei1-1/+2
2017-09-30nso: Refactor and allocate .bss section.bunnei1-2/+3
2017-09-30elf: Check if machine is ARM.bunnei1-2/+9
2017-09-27Loaders: Don't automatically set the current process every time we load an application.Subv1-8/+7
The loaders will now just create a Kernel::Process, construct it and return it to the caller, which is responsible for setting it as the current process and configuring the global page table.
2017-09-24memory: Add GetCurrentPageTable/SetCurrentPageTableMerryMage1-1/+1
Don't expose Memory::current_page_table as a global.
2017-09-10Kernel/Memory: Give each Process its own page table.Subv1-0/+1
The loader is in charge of setting the newly created process's page table as the main one during the loading process.
2017-05-08Remove ability to load symbol mapsYuri Kunde Schlesner1-32/+0
This was now mostly unused except by thread creation, which used a symbol of the entrypoint, if available, to name the thread.
2016-09-21Use negative priorities to avoid special-casing the self-includeYuri Kunde Schlesner1-1/+1
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot1-3/+1
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot1-104/+127
2016-01-25elf: Don't cast away constLioncash1-3/+3
2015-07-14Loader: Fix variable type and remove unused variableYuri Kunde Schlesner1-2/+1
2015-07-14Loader: Remove unnecessary pointer indirection to IOFileYuri Kunde Schlesner1-4/+4
2015-07-12Core: Properly configure address space when loading a binaryYuri Kunde Schlesner1-15/+66
The code now properly configures the process image to match the loaded binary segments (code, rodata, data) instead of just blindly allocating a large chunk of dummy memory.
2015-06-28CitraQt: Cleanup includes.Emmanuel Gil Peyrot1-1/+2
2015-05-15Core/ResourceLimits: Implemented the basic structure of ResourceLimits.Subv1-0/+4
Implemented svcs GetResourceLimit, GetResourceLimitCurrentValues and GetResourceLimitLimitValues. Note that the resource limits do not currently keep track of used objects, since we have no way to distinguish between an object created by the application, and an object created by some HLE module once we're inside Kernel::T::Create.
2015-05-15Memmap: Re-organize memory function in two filesYuri Kunde Schlesner1-1/+1
memory.cpp/h contains definitions related to acessing memory and configuring the address space mem_map.cpp/h contains higher-level definitions related to configuring the address space accoording to the kernel and allocating memory.
2015-05-09Memory: Re-organize and rename memory area address constantsYuri Kunde Schlesner1-1/+1
2015-05-09Process: Rename StaticAddressMapping => AddressMappingYuri Kunde Schlesner1-1/+1
2015-05-09Process: Support parsing of exheader kernel capsYuri Kunde Schlesner1-0/+1
2015-05-09Kernel: Introduce skeleton Process class to hold process dataYuri Kunde Schlesner1-4/+9
2015-05-07Common: Remove common.hYuri Kunde Schlesner1-1/+2
2015-01-30Silence a few warnings.Rohit Nirmal1-2/+2
2015-01-15Loader: Clean up the ELF AppLoader.Emmanuel Gil Peyrot1-40/+33
2015-01-15Loader: Guess filetype from the magic, or fallback to the extension.Emmanuel Gil Peyrot1-0/+12
2015-01-15Loader: Don’t assume the file hasn’t been read before.Emmanuel Gil Peyrot1-0/+3
2015-01-15Loader: Keep a reference to the file and pass it to the correct AppLoader, instead of loading it multiple times.Emmanuel Gil Peyrot1-22/+8
2015-01-15Loader: Never forget to change is_loaded.Emmanuel Gil Peyrot1-1/+3
2015-01-15Loader: Don’t duplicate the docstring into the cpp file.Emmanuel Gil Peyrot1-6/+0
2015-01-03elf: Make DidRelocate constLioncash1-1/+1
2014-12-21License changepurpasmart961-2/+2
2014-12-13Convert old logging calls to new logging macrosYuri Kunde Schlesner1-8/+8
2014-11-19Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generatedEmmanuel Gil Peyrot1-2/+2
2014-09-17Common: Rename the File namespace to FileUtil, to match the filename and prevent collisions.Emmanuel Gil Peyrot1-1/+1
2014-06-25ELF: Refactored LoadInto(..) to use memcpy, removed unnecessary code.bunnei1-19/+8
2014-06-25Loader: Refactored use of const.bunnei1-2/+2
2014-06-25Loader: Implemented AppLoader interface for abstracting application loading.bunnei1-61/+257
- Various cleanups/refactorings to Loader, ELF, and NCCH modules. - Added AppLoader interface to ELF and NCCH. - Updated Qt/GLFW frontends to check AppLoader ResultStatus. NCCH: Removed extra qualification typos. Loader: Removed unnecessary #include's. NCCH: Improved readability of memcmp statements. NCCH: Added missing space. Elf: Removed unnecessary usage of unique_ptr. Loader: Removed unnecessary usage of unique_ptr.
2014-06-17Loader: Cleaned up and removed unused code, refactored ELF namespace.bunnei1-56/+51
2014-06-17Elf: Renamed modules to be consistent with new loader naming, fixed tabs -> spaces.bunnei1-0/+190