Repository navigation
Commit 772dc70
committed
Add PT_GNU_STACK segment if supported
Recent glibc reject dlopen on shared libs containing no or a PF_X
PT_GNU_STACK header, so lets emit something reasonable:
When any of the input files (among them the systems crt*.o)
have a .note.GNU-stack section we assume that that program header
type is supported by the systems loader. We then emit a PT_GNU_STACK
program header (always at least read-write no matter the input sections
flags) and add PF_X if any input file did in fact request an executable
stack.
We don't support configuring that from command line.1 parent 49ed952 commit 772dc70
2 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
| 938 | + | |
938 | 939 | | |
939 | 940 | | |
940 | 941 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2417 | 2417 | | |
2418 | 2418 | | |
2419 | 2419 | | |
2420 | | - | |
| 2420 | + | |
2421 | 2421 | | |
2422 | 2422 | | |
2423 | 2423 | | |
| |||
2436 | 2436 | | |
2437 | 2437 | | |
2438 | 2438 | | |
| 2439 | + | |
| 2440 | + | |
2439 | 2441 | | |
2440 | 2442 | | |
2441 | 2443 | | |
| |||
2552 | 2554 | | |
2553 | 2555 | | |
2554 | 2556 | | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
2555 | 2563 | | |
2556 | 2564 | | |
2557 | 2565 | | |
| |||
3447 | 3455 | | |
3448 | 3456 | | |
3449 | 3457 | | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
3450 | 3461 | | |
3451 | 3462 | | |
3452 | 3463 | | |
| |||
0 commit comments