957 questions
2
votes
0
answers
110
views
Rust reorders method params in machine code? Third arg in x4?
I have a function that I marked #inline(never). I ran cargo build --release and objdump -d [binary name]. What I see is that my 3d parameter (hi) is in register x4 for some reason. I'd expect it to be ...
5
votes
1
answer
149
views
Does adding a virtual destructor break ABI compatibility?
I have a class hierarchy that already exists that looks like this:
class parent {
public:
parent();
~parent();
virtual void foo(){}
};
class child : public parent {
public:
child();
...
27
votes
2
answers
2k
views
Why does clang zero "eax" before calling a function with unspecified parameters, but gcc doesn't?
Consider this C (not C++!) code:
int g();
int f() {
return g();
}
Clang (with any optimization level above zero) compiles this to:
f:
xor eax, eax
jmp g@PLT
I am trying ...
Advice
0
votes
3
replies
123
views
Misunderstanding System V x86_64 ABI
My question is how this structure passed and returned from function?
struct S
{
int a[5];
};
I read ABI. As far as I understand if the size of structure less then 64 bytes it will separate to ...
1
vote
1
answer
69
views
What are the differences between a x86 VxWorks and a Linux object files
There are two ways to create VxWorks applications:
Real-time processes (RTP), which are akin to a process in the Unix world.
Downloadable kernel modules (DKM), which run in kernel mode, akin to a ...
10
votes
2
answers
124
views
Why is the AL field (FP register usage count) necessary in the SysV ABI?
I was going through the System V AMD64 ABI and couldn’t find a clear explanation for why the AL field (which tracks how many floating-point registers are used) is necessary.
From my understanding, ...
2
votes
1
answer
254
views
Forcing a C program to take a forged epilogue made with inline-assembly to jump to arbitrary function
This comes from a post about invoking a trivial buffer overflow (to jump to a function present in the source but not called explicitly in any place of the program (2333909/how-can-i-invoke-buffer-...
0
votes
0
answers
31
views
Android App Crashes on Launch for Specific Devices [duplicate]
Android App Crashes on Launch for Specific Devices (Samsung Galaxy A12) - No Crashlytics Logs
Problem Description
My Android app works perfectly for most users, but some users are experiencing crashes ...
0
votes
1
answer
94
views
How to correctly ABI-decode multicall results (ERC-20 decimals + symbol) in tests?
I’m trying to understand ABI decoding of multicall RPC calls so I can create stubbed tests using WireMock for my Rust EVM application.
The multicall function signature is:
function aggregate(Call[] ...
1
vote
0
answers
57
views
How to initialize stack pointer in x86 assembler on Linux [duplicate]
Given the example of a simple program for GNU assembler on i386 architecture in Linux:
.section .data
msg: .ascii "Hi, People!\n"
len = . - msg
.section .text
.global _start
_start:
# ...
1
vote
1
answer
108
views
Is [[__no_unique_address__]] applied to second members in this tail padding optimization check in libc++ redundant?
In the libc++ implementation of std::expected, there is this helper variable template:
// This function returns whether the type `_Second` can be stuffed into the tail padding
// of the `_First` type ...
1
vote
2
answers
132
views
C++ polymorphism across boundaries in shared libraries
I am developing a simple logic-gate simulation.
For each logic gate type the following class is implemented:
class Gate {
public:
explicit Gate();
virtual ~Gate() = default;
virtual void ...
15
votes
1
answer
918
views
What is correct mental model for [[no_unique_address]] in C++?
I recently found out about [[no_unique_address]] attribute in C++. According to cppreference.com:
Applies to the name being declared in the declaration of a non-static data member that is not a bit-...
0
votes
1
answer
87
views
Why is the static chain pointer needed for nested functions?
I stumbled upon the static chain pointer while reading about the System V ABI and I found this explanation on its usage in nested functions.
I am curious, why do we need the static chain pointer at ...
3
votes
2
answers
605
views
electron-builder building issue "can't detect abi"
I was trying to use electron-builder to build my app, and I get an error.
It worked a month ago and I didn't change anything in the package.json file, but now it doesn't work. The app does work when I ...