accelerator/patches/0002-Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch
sappho 1d60f3746a
overhaul -> overhaul (#21)
* overhaul the repository

add protobuf

change repo url

try to restore github python syntax highlighter

move breakpad into third_party, update packagescript

* AMBuildifying

remove unnecessary files

Move the git patching into ambuild

move lss to a patch

Add windows compilation support

remove breakpad.bat

move postlink libs

* Overhaul CI (#4)

* Dockerbuild (#5)

* make cwd_cmd spew stdout and stderr

* add proper docker build support

* Overhaul ci (#6)

* Setup CI

* fix checkout

* fix yaml syntax

* no fail fast

* setup CI cache

* Fix pip install

* remove pip git

* update actions, ditch node 16

* small syntax cleanups

* more CI changes

* github doc lied

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>

* final push for perfect dockerbuilds in every scenario that i have been able to find

* rename cicd->dockerbuild

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>

* Add readme, remode duplicate -fPIC

update names of dockerbuild folder in sh files

* cleanup dockerfile (#7)

* Update 0002-Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch

* Statically link libz, libgcc & libstdc++

* fix submodule path

* Review change + comment patch

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
Co-authored-by: Benoist <14257866+Kenzzer@users.noreply.github.com>
2024-10-10 21:59:28 -04:00

48 lines
1.8 KiB
Diff

From 8aaf6e84a6704eb538f68a3e6fb6c3a8c93f1d8d Mon Sep 17 00:00:00 2001
From: Asher Baker <asherkin@limetech.io>
Date: Sun, 13 Jan 2019 12:35:05 +0000
Subject: [PATCH 2/5] Write FUNC records instead of PUBLIC for ELF symbols with
sizes
---
src/common/linux/elf_symbols_to_module.cc | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/common/linux/elf_symbols_to_module.cc b/src/common/linux/elf_symbols_to_module.cc
index 70d50f89..f21460bf 100644
--- a/src/common/linux/elf_symbols_to_module.cc
+++ b/src/common/linux/elf_symbols_to_module.cc
@@ -163,19 +163,28 @@ bool ELFSymbolsToModule(const uint8_t* symtab_section,
while(!iterator->at_end) {
if (ELF32_ST_TYPE(iterator->info) == STT_FUNC &&
iterator->shndx != SHN_UNDEF) {
- auto ext = std::make_unique<Module::Extern>(iterator->value);
- ext->name = SymbolString(iterator->name_offset, strings);
+ string name = SymbolString(iterator->name_offset, strings);
#if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle.
int status = 0;
char* demangled =
- abi::__cxa_demangle(ext->name.c_str(), NULL, NULL, &status);
+ abi::__cxa_demangle(name.c_str(), NULL, NULL, &status);
if (demangled) {
if (status == 0)
- ext->name = demangled;
+ name = demangled;
free(demangled);
}
#endif
+#if 1
+ if (iterator->size) {
+ Module::Function *fun = new Module::Function(module->AddStringToPool(name), iterator->value);
+ fun->ranges.push_back(Module::Range(iterator->value, iterator->size));
+ module->AddFunction(fun);
+ }
+#else
+ Module::Extern *ext = new Module::Extern(iterator->value);
+ ext->name = name;
module->AddExtern(std::move(ext));
+#endif
}
++iterator;
}