History

Add -Wl,-I and -Wl,-dynamic-linker options

Compatible with ld.bfd, gold, lld and mold. Also, document existing behaviour of LD_SO environment variable

remph committed 1 year ago

Commit ec60d281 parent f8bd1365 files · +18 −1Browse files

Showing the changes to libtcc.c (1 of 5 files). Show all

Unified · Split

libtcc.c+7−0
@@ -1428,6 +1428,13 @@ static int tcc_set_linker(TCCState *s, const char *option) · 1427 unmodified lines
14281428 s->rdynamic = 1;
14291429 } else if (link_option(option, "rpath=", &p)) {
14301430 copy_linker_arg(&s->rpath, p, ':');
1431+ } else if (link_option(option, "dynamic-linker=", &p)
1432+ || link_option(option, "I=", &p)) {
1433+ copy_linker_arg(&s->elfint, p, 0);
1434+ } else if (strncmp("-I/", option, 3) == 0
1435+ || strncmp("-I.", option, 3) == 0) {
1436+ p = option;
1437+ copy_linker_arg(&s->elfint, option + 2, 0);
14311438 } else if (link_option(option, "enable-new-dtags", &p)) {
14321439 s->enable_new_dtags = 1;
14331440 } else if (link_option(option, "section-alignment=", &p)) {

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