ld: handle input file options

This commit is contained in:
Mikael Pettersson
2020-05-24 17:38:51 +02:00
parent e24b529f05
commit e1320acc78
2 changed files with 5 additions and 1 deletions

View File

@@ -245,6 +245,7 @@ process_option(Opt, Options) ->
'EB' -> handle_EB(Opt, Options);
{$m, _} -> handle_emulation(Opt, Options);
{$e, _} -> handle_entry(Opt, Options);
{1, _} -> handle_file(Opt, Options);
{$b, _} -> handle_format(Opt, Options);
help -> handle_help(Opt, Options);
{$l, _} -> handle_library(Opt, Options);
@@ -285,6 +286,9 @@ handle_entry({$e, Entry}, Options) ->
end,
{ok, Options#options{entry = EntryVal}}.
handle_file({1, File}, Options) ->
{ok, Options#options{files = [{file, File} | Options#options.files]}}.
handle_format({$b, InputFormat}, Options) ->
case InputFormat of
?OBJFORMAT -> {ok, Options};

View File

@@ -45,7 +45,7 @@ input(Files, UndefSyms) ->
end, maps:new(), UndefSyms),
input(Files, maps:new(), UndefMap, []).
input([File | Files], DefMap, UndefMap, Inputs) ->
input([{file, File} | Files], DefMap, UndefMap, Inputs) ->
case read_file(File) of
{ok, {ShTab, SymTab, StShNdx}} ->
case update_sym_maps(SymTab, File, DefMap, UndefMap) of