about summary refs log tree commit diff
path: root/src/process/posix_spawnattr_setflags.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2021-01-30 16:42:26 -0500
committerRich Felker <dalias@aerifal.cx>2021-01-30 16:42:26 -0500
commit9afed99c224ab33578623744f40d31bee84ec6ba (patch)
tree6a8daab8e1dad8e3605c6d9dfa9f285b9735dadf /src/process/posix_spawnattr_setflags.c
parentdd5b6384712fb554bb6e291f2bbcdc9ec2f66554 (diff)
downloadmusl-9afed99c224ab33578623744f40d31bee84ec6ba.tar.gz
musl-9afed99c224ab33578623744f40d31bee84ec6ba.tar.xz
musl-9afed99c224ab33578623744f40d31bee84ec6ba.zip
fix inconsistent signature of __libc_start_main
commit 7586360badcae6e73f04eb1b8189ce630281c4b2 removed the unused
arguments from the definition of __libc_start_main, making it
incompatible with the declaration at the point of call, which still
passed 6 arguments. calls with mismatched function type have undefined
behavior, breaking LTO and any other tooling that checks for function
signature mismatch.

removing the extra arguments from the point of call (crt1) is not an
option for fixing this, since that would be a change in ABI surface
between application and libc.

adding back the extra arguments requires some care. on archs that pass
arguments on the stack or that reserve argument spill space for the
callee on the stack, it imposes an ABI requirement on the caller to
provide such space. the modern crt1.c entry point provides such space,
but originally there was arch-specific asm for the call to
__libc_start_main. the last of this asm was removed in commit
6fef8cafbd0f6f185897bc87feb1ff66e2e204e1, and manual review of the
code removed and its prior history was performed to check that all
archs/variants passed the legacy init/fini/ldso_fini arguments.
Diffstat (limited to 'src/process/posix_spawnattr_setflags.c')
0 files changed, 0 insertions, 0 deletions