blob: 9e50cb041ec1c8c5c61cdf967dc9cefbfc87d1f8 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001use strict;
2
3my @target_lib=("el1", "tstm_meta",
4 "edsphwram", "el1d", "el1d_agc", "el1d_ext", "el1d_pub", "el1d_tpc",
5 "mml1", "mml1_pcore", "mml1_rf", "mml1_rf_ext_pcore", "mml1_rf_pcore",
6 "nl1", "nl1_pub",
7 "mml1_agc", "mml1_rxdfe", "mml1_tpc", "mml1_txdfe");
8
9open INPUT_FD, "<$ARGV[0]";
10open OUT_FD, ">$ARGV[1]";
11my @obj_list;
12
13while(<INPUT_FD>)
14{
15 if (/Allocating common symbols/)
16 {
17 last;
18 }
19
20 for(my $i=0; $i <= $#target_lib;$i++)
21 {
22 my $lib_str="lib".$target_lib[$i].".a";
23 if (/$lib_str\((\S+)\.obj\)/)
24 {
25 my $obj_name = $1.".obj";
26 push (@obj_list, $obj_name);
27 last;
28 }
29 }
30}
31
32for(my $i = 0; $i <= $#obj_list; $i++)
33{
34 my $lds_sec = "*".$obj_list[$i]." (.text*)";
35 print OUT_FD "$lds_sec\n";
36}
37
38close INPUT_FD;
39close OUT_FD;