257 karma · joined Mar 23, 2012 (14y ago) · 91 submissions
comment 2y ago · link · parent
rr record /tmp/Debug/bin/llvm-mc a.s && rr replay -d cgdb
I've have success story with some bugs only reproducible with LTO. Without rr it would be a significant challenge.
It would be nice if Linux kernel could be debugged with rr. Does anyone have success with kernel under rr+qemu ? :)
comment 2y ago · link · parent
- Mapping symbols describe data in code and instruction sets transition (e.g. A32<=>T32).
- Pending LLVM integrated assembler patch that will eliminate almost all mapping symbols without breaking disassemblers https://github.com/llvm/llvm-project/pull/99718
- RISC-V ISA extension `$x<ISA>` (unimplemented yet) would raise question where the relocatable files are more heterogeneous.
- Mach-O LC_DATA_IN_CODE describes ranges.
- Compressed .strtab and .symtab might be beneficial.
33.
Mapping Symbols: Rethinking for Efficiency(maskray.me ↗)
16 points · by MaskRay · 2y ago · 1 comment
34.
1 points · by MaskRay · 2y ago · discuss
comment 2y ago · link · parent
(I aim to write blog posts every 2-3 weeks, but this latest one was postponed... I wrote this in relatively short time so that the gap would not be too long, and I really should take time to refine the post.)
comment 2y ago · link · parent
You might also want to replace the malloc with mimalloc/snmalloc, which might yield ~10% performance boost.
39.
Integrated assembler improvements in LLVM 19(maskray.me ↗)
104 points · by MaskRay · 2y ago · 27 comments
comment 2y ago · link · parent
https://github.com/orgs/community/discussions/3478 ("Improve workflow when force-pushing during code reviews") could use more support.
I've also got lots of complaints in this section when LLVM switched to GitHub PR: https://maskray.me/blog/2023-09-09-reflections-on-llvm-switc...
comment 2y ago · link · parent
> Second draft published May 3, 1999. > ... > New dynamic section tags DT_RUNPATH and DT_FLAGS added. Dynamic section tag DT_RPATH moved to level 2.
In glibc, DT_RPATH and DT_RUNPATH have different semantics regarding precedence related to LD_LIBRARY_PATH. In FreeBSD rtld and musl, DT_RPATH and DT_RUNPATH are equivallent.
comment 2y ago · link · parent
In llvm-project, obj2yaml pretty prints an object file in YAML and yaml2obj can convert the output back to an object file.
The test cases are a good way to explore the functionality: https://github.com/llvm/llvm-project/tree/main/llvm/test/too... https://github.com/llvm/llvm-project/tree/main/llvm/test/too...
comment 2y ago · link · parent
I have analyzed a few object file formats in another blog post https://maskray.me/blog/2024-01-14-exploring-object-file-for... (HN discussion: https://news.ycombinator.com/item?id=38998914)
ELF is technically not complicated and simpler than COFF and Mach-O.
comment 2y ago · link · parent
- 2011- Xinous, but Xinous has stopped updating https://www.sco.com/developers/gabi/latest/contents.html . It seems that Xinous has moved on from System V based OpenServer/UnixWare. The newer OpenServer seems to be based on FreeBSD. They likely no longer care about the System V ABI.
Nowadays, people make proposals to the generic-abi Google Group. Essentially, a proposal is considered "standardized" if it receives approval from GNU, LLVM, and Ali Bahrami (Solaris representative).
Many GNU extensions are implemented by LLVM and adopted by BSD and newer ELF-based OSes. For extensions that are considered generic enough, it's recommended to propose them through the generic-abi Google Group. psABI documents generally prefer generic extensions over GNU or LLVM-specific ones.
comment 2y ago · link · parent
47.
Another Year with Decker(beyondloom.com ↗)
1 points · by MaskRay · 2y ago · 1 comment
comment 2y ago · link · parent
comment 2y ago · link · parent
* ISA manual * ELF (generic ABI, psABI (e.g. x86-64-psABI), OSABI) * DWARF * Floating-point * Language standards * Itanium C++ ABI
and probably a few other stuff.
> it seems like my failure to find the most up-to-date specification is simply because one doesn't exist.
While the up-to-date specification is unavailable, hopefully it is not too bad because all essential features have been completed as of 2001:)
RELR is a linker and loader feature, not on the compiler side. Compressed debug sections are a pretty natural extension.
comment 2y ago · link · parent
I have two specific questions:
- Key features (symbol visibility, section groups, SHF_MERGE, etc) were all available as of April 2001. Where can we find the discussion mailing lists? Are they still available?
- How does the ABI end up being “All rights reserved” by SCO? Tool Interface Standard (TIS) Portable Formats Specification, version 1.2 effectively put the specification in the public domain.
51.
Evolution of the ELF object file format(maskray.me ↗)
148 points · by MaskRay · 2y ago · 51 comments
comment 2y ago · link · parent
Sony developers have proposed changes to improve the debugging experience and some work has been done, e.g. https://discourse.llvm.org/t/rfc-redefine-og-o1-and-add-a-ne...
* change representation to help make -g not change codegen : https://discourse.llvm.org/t/rfc-debuginfo-proposed-changes-...
comment 2y ago · link · parent
Both GNU assembler and LLVM integrate assembler parse and match instructions only once. hey then store an internal representation in memory and perform fixed-point iteration. The section/fragment representation gives a lot of flexibility.
In contrast, nasm parses and matches instructions multiple times depending on the optimization level. It also assigns addresses during parsing and uses an ad-hoc method for JMP/JCC instructions. The end conditions of the fixed-point iteration algorithm (global_offset_changed and stall_count) seem unconventional. -O0 does not "relax all" short jumps to near jumps.
comment 2y ago · link · parent
``` Mode | Execution Time | Debuggability | Compile Time O0 | 1.0000 | 1.0000 | 1.0000 Og | 0.3439 | 0.5357 | 1.8630 O1 | 0.3082 | 0.4241 | 1.7880 O2g | 0.2823 | 0.4845 | 3.0420 O2 | 0.2514 | 0.3908 | 2.9380 ```