This option is needed for openssl to create a correct library.
Unified · Split
| @@ -1457,6 +1457,8 @@ static int tcc_set_linker(TCCState *s, const char *optarg) · 1456 unmodified lines | |||
| 1457 | s->filetype |= AFF_WHOLE_ARCHIVE; | 1457 | s->filetype |= AFF_WHOLE_ARCHIVE; |
| 1458 | } else if (link_option(&o, "no-whole-archive")) { | 1458 | } else if (link_option(&o, "no-whole-archive")) { |
| 1459 | s->filetype &= ~AFF_WHOLE_ARCHIVE; | 1459 | s->filetype &= ~AFF_WHOLE_ARCHIVE; |
| 1460 | } else if (link_option(&o, "znodelete")) { | ||
| 1461 | s->znodelete = 1; | ||
| 1460 | #ifdef TCC_TARGET_PE | 1462 | #ifdef TCC_TARGET_PE |
| 1461 | } else if (link_option(&o, "large-address-aware")) { | 1463 | } else if (link_option(&o, "large-address-aware")) { |
| 1462 | s->pe_characteristics |= 0x20; | 1464 | s->pe_characteristics |= 0x20; |
| @@ -741,6 +741,7 @@ struct TCCState { · 740 unmodified lines | |||
| 741 | unsigned char static_link; /* if true, static linking is performed */ | 741 | unsigned char static_link; /* if true, static linking is performed */ |
| 742 | unsigned char rdynamic; /* if true, all symbols are exported */ | 742 | unsigned char rdynamic; /* if true, all symbols are exported */ |
| 743 | unsigned char symbolic; /* if true, resolve symbols in the current module first */ | 743 | unsigned char symbolic; /* if true, resolve symbols in the current module first */ |
| 744 | unsigned char znodelete; /* Set DF_1_NODELETE in dynamic section */ | ||
| 744 | unsigned char filetype; /* file type for compilation (NONE,C,ASM) */ | 745 | unsigned char filetype; /* file type for compilation (NONE,C,ASM) */ |
| 745 | unsigned char optimize; /* only to #define __OPTIMIZE__ */ | 746 | unsigned char optimize; /* only to #define __OPTIMIZE__ */ |
| 746 | unsigned char option_pthread; /* -pthread option */ | 747 | unsigned char option_pthread; /* -pthread option */ |
| @@ -2939,6 +2939,8 @@ static int elf_output_file(TCCState *s1, const char *filename) · 2938 unmodified lines | |||
| 2939 | put_dt(dynamic, DT_TEXTREL, 0); | 2939 | put_dt(dynamic, DT_TEXTREL, 0); |
| 2940 | if (file_type & TCC_OUTPUT_EXE) | 2940 | if (file_type & TCC_OUTPUT_EXE) |
| 2941 | dt_flags_1 = DF_1_NOW | DF_1_PIE; | 2941 | dt_flags_1 = DF_1_NOW | DF_1_PIE; |
| 2942 | if (s1->znodelete) | ||
| 2943 | dt_flags_1 |= DF_1_NODELETE; | ||
| 2942 | } | 2944 | } |
| 2943 | put_dt(dynamic, DT_FLAGS, DF_BIND_NOW); | 2945 | put_dt(dynamic, DT_FLAGS, DF_BIND_NOW); |
| 2944 | put_dt(dynamic, DT_FLAGS_1, dt_flags_1); | 2946 | put_dt(dynamic, DT_FLAGS_1, dt_flags_1); |