public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/31663] New: Stack not aligned at _start when calling ld.so explicitly
@ 2024-04-19 22:35 mail@felix-potthast.de
  2024-04-19 22:38 ` [Bug dynamic-link/31663] " mail@felix-potthast.de
  2024-04-20  7:03 ` schwab@linux-m68k.org
  0 siblings, 2 replies; 3+ messages in thread
From: mail@felix-potthast.de @ 2024-04-19 22:35 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31663

            Bug ID: 31663
           Summary: Stack not aligned at _start when calling ld.so
                    explicitly
           Product: glibc
           Version: 2.35
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: mail@felix-potthast.de
  Target Milestone: ---

Up to glibc version 2.35 the stack is not 16-byte aligned when the process is
entered at _start when ld.so was called explicitly.

The x86-64 SYS V ABI explicitly states it has to be aligned at that point,
though.
It also works fine when ld.so is invoked as elf interpreter.

This doesn't result in any issue most of the time because the stack
is aligned between _start and main in `sysdeps/x86_64/start.S`, for legacy
reasons probably.

I think the right place to do this alignment is at the end of ld.so.


I attached a simple example that can be build with
`gcc -nostartfiles test.S -o test`.

It runs fine when running `./test` but segfaults when running with
`/lib64/ld-linux-x86-64.so.2 ./test` due to missing stack alignment.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug dynamic-link/31663] Stack not aligned at _start when calling ld.so explicitly
  2024-04-19 22:35 [Bug dynamic-link/31663] New: Stack not aligned at _start when calling ld.so explicitly mail@felix-potthast.de
@ 2024-04-19 22:38 ` mail@felix-potthast.de
  2024-04-20  7:03 ` schwab@linux-m68k.org
  1 sibling, 0 replies; 3+ messages in thread
From: mail@felix-potthast.de @ 2024-04-19 22:38 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31663

--- Comment #1 from Felix Potthast <mail@felix-potthast.de> ---
Created attachment 15475
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15475&action=edit
testcase

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug dynamic-link/31663] Stack not aligned at _start when calling ld.so explicitly
  2024-04-19 22:35 [Bug dynamic-link/31663] New: Stack not aligned at _start when calling ld.so explicitly mail@felix-potthast.de
  2024-04-19 22:38 ` [Bug dynamic-link/31663] " mail@felix-potthast.de
@ 2024-04-20  7:03 ` schwab@linux-m68k.org
  1 sibling, 0 replies; 3+ messages in thread
From: schwab@linux-m68k.org @ 2024-04-20  7:03 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31663

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> ---
dup

*** This bug has been marked as a duplicate of bug 31662 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-20  7:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-19 22:35 [Bug dynamic-link/31663] New: Stack not aligned at _start when calling ld.so explicitly mail@felix-potthast.de
2024-04-19 22:38 ` [Bug dynamic-link/31663] " mail@felix-potthast.de
2024-04-20  7:03 ` schwab@linux-m68k.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).