History

Add -znodelete linker option

This option is needed for openssl to create a correct library.

herman ten brugge committed 1 year ago

Commit f8eb5f41 parent 19fdef43 files · +5 −0Browse files

Unified · Split

3 files
  1. libtcc.c +2 −0
  2. tcc.h +1 −0
  3. tccelf.c +2 −0
libtcc.c+2−0
@@ -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_PE1462#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;
tcc.h+1−0
@@ -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 */
tccelf.c+2−0
@@ -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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t