@@ -114,16 +114,27 @@ def archive(self, objects, lib_path):
114
114
self .default_cmd ([self .ar , '-r' , lib_path ] + objects )
115
115
116
116
def link (self , output , objects , libraries , lib_dirs , mem_map ):
117
- args = ["-o" , output , "--userlibpath" , "," .join (lib_dirs ), "--info=totals" , "--list=.link_totals.txt" ]
117
+ if len (lib_dirs ):
118
+ args = ["-o" , output , "--userlibpath" , "," .join (lib_dirs ), "--info=totals" , "--list=.link_totals.txt" ]
119
+ else :
120
+ args = ["-o" , output , "--info=totals" , "--list=.link_totals.txt" ]
121
+
118
122
if mem_map :
119
123
args .extend (["--scatter" , mem_map ])
120
-
121
- self .default_cmd (self .hook .get_cmdline_linker (self .ld + args + objects + libraries + self .sys_libs ))
124
+
125
+ if hasattr (self .target , "link_cmdline_hook" ):
126
+ args = self .target .link_cmdline_hook (self .__class__ .__name__ , args )
127
+
128
+ self .default_cmd (self .ld + args + objects + libraries + self .sys_libs )
122
129
123
130
@hook_tool
124
131
def binary (self , elf , bin ):
125
- self .default_cmd (self .hook .get_cmdline_binary ([self .elf2bin , '--bin' , '-o' , bin , elf ]))
132
+ args = [self .elf2bin , '--bin' , '-o' , bin , elf ]
133
+
134
+ if hasattr (self .target , "binary_cmdline_hook" ):
135
+ args = self .target .binary_cmdline_hook (self .__class__ .__name__ , args )
126
136
137
+ self .default_cmd (args )
127
138
128
139
class ARM_STD (ARM ):
129
140
def __init__ (self , target , options = None , notify = None , macros = None ):
0 commit comments