Remove ELFSymbolTable from PCB

This commit is contained in:
EnderIce2
2024-02-28 06:11:31 +02:00
parent e74c5f7bab
commit ddad5ca38a
8 changed files with 13 additions and 92 deletions

View File

@ -317,18 +317,6 @@ namespace Execute
TargetProcess->ProgramBreak->InitBrk(ProgramBreak);
}
struct stat statbuf;
fstat(fd, &statbuf);
Memory::SmartHeap sh = Memory::SmartHeap(statbuf.st_size);
lseek(fd, 0, SEEK_SET);
fread(fd, sh, statbuf.st_size);
TargetProcess->ELFSymbolTable->AppendSymbols(uintptr_t(sh.Get()));
#ifdef DEBUG
if (!TargetProcess->ELFSymbolTable->SymTableExists)
debug("NO SYMBOL TABLE FOUND?");
#endif
debug("Entry Point: %#lx", EntryPoint);
this->GenerateAuxiliaryVector_x86_64(vma, fd, ELFHeader,
@ -742,18 +730,6 @@ namespace Execute
/* ------------------------------------------------------------------------ */
struct stat statbuf;
fstat(fd, &statbuf);
Memory::SmartHeap sh = Memory::SmartHeap(statbuf.st_size);
lseek(fd, 0, SEEK_SET);
fread(fd, sh, statbuf.st_size);
TargetProcess->ELFSymbolTable->AppendSymbols(uintptr_t(sh.Get()), BaseAddress);
if (!TargetProcess->ELFSymbolTable->SymTableExists)
{
debug("NO SYMBOL TABLE FOUND?");
}
debug("Entry Point: %#lx", EntryPoint);
this->GenerateAuxiliaryVector_x86_64(vma, fd, ELFHeader,

View File

@ -99,11 +99,6 @@ namespace Execute
/* ------------------------------------------------------------------------------------------------------------------------------ */
void *ElfFile = KernelAllocator.RequestPages(TO_PAGES(statbuf.st_size + 1));
fread(fd, (uint8_t *)ElfFile, statbuf.st_size);
debug("Loaded elf %s at %#lx with the length of %ld",
Path, ElfFile, statbuf.st_size);
PCB *Process;
if (Fork)
{
@ -119,10 +114,7 @@ namespace Execute
}
fixme("free allocated memory");
fixme("change symbol table");
// Process->vma->FreeAllPages();
delete Process->ELFSymbolTable;
Process->ELFSymbolTable = new SymbolResolver::Symbols((uintptr_t)ElfFile);
}
else
{
@ -132,8 +124,7 @@ namespace Execute
Process = TaskManager->CreateProcess(Parent,
BaseName,
TaskExecutionMode::User,
ElfFile, false,
0, 0);
false, 0, 0);
Process->Info.Compatibility = Compatibility;
Process->Info.Architecture = Arch;
}
@ -141,8 +132,6 @@ namespace Execute
Process->SetWorkingDirectory(fs->GetNodeFromPath(Path)->Parent);
Process->SetExe(Path);
KernelAllocator.FreePages(ElfFile, TO_PAGES(statbuf.st_size + 1));
ELFObject *obj = new ELFObject(Path, Process, argv, envp);
if (!obj->IsValid)
{