2

It seems like ltrace is showing more parameters then the functions provide, take for instance this

getauxval(31, 0x7ffe5ee5a5c0, 0, 0x7066732e6d657473) = 0x7f4f747cd030

Why are there 4 parameters there, two integers two memory locations rather than one parameter which is all Linux's getauxval seems to support? What's the right way to read the output of ltrace?

Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
  • Related: [How does ltrace() display rand()](https://stackoverflow.com/questions/48131925/how-does-ltrace-display-rand). ltrace gets its info about library function arguments from various `.conf` files that ship with it, but they don't include every library function. If a function isn't found in any `.conf` file, ltrace displays exactly four arguments. – Mark Plotnick Oct 31 '18 at 15:02

1 Answers1

3

I've stumbled upon the same question. After some research and comparison with the source file, I found out that these arguments are the values of the stack variables at the time the function is called. So If you expect (know) your function to have only 1 argument, this will be the first parameter, everything after that are the variables on the function stack

OSAI_42
  • 31
  • 2