gen_eh_elf: symlinks: remove if present

This commit is contained in:
Théophile Bastian 2018-06-12 16:36:32 +02:00
parent 65b08a444a
commit d53fcd22c6
1 changed files with 6 additions and 0 deletions

View File

@ -198,6 +198,12 @@ def gen_eh_elf(obj_path, config):
# Re-create symlinks
for elt in link_chain:
if os.path.exists(elt[0]):
if not os.path.islink(elt[0]):
raise Exception(
"{}: file already exists and is not a symlink.".format(
elt[0]))
os.remove(elt[0])
os.symlink(elt[1], elt[0])