mk: generate .data symbols with distinct values/addresses

Prevent the static linker from assuming weak object symbols to be alias
symbols for unrelated non-weak symbols with the same value/address.

Fixes #3458
This commit is contained in:
Christian Prochaska 2019-07-20 18:19:30 +02:00 committed by Christian Helmuth
parent 35c724512d
commit 85b1563e57
1 changed files with 2 additions and 2 deletions

View File

@ -153,8 +153,8 @@ endif
%.symbols.s: %.symbols
$(MSG_CONVERT)$@
$(VERBOSE)\
sed -e "s/^\(\w\+\) D \(\w\+\)\$$/.data; .global \1; .type \1,%object; .size \1,\2; \1:/" \
-e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%object; \1:/" \
sed -e "s/^\(\w\+\) D \(\w\+\)\$$/.data; .global \1; .type \1,%object; .size \1,\2; \1: .skip 1/" \
-e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%object; \1: .skip 1/" \
-e "s/^\(\w\+\) T/.text; .global \1; .type \1,%function; \1:/" \
-e "s/^\(\w\+\) R \(\w\+\)\$$/.section .rodata; .global \1; .type \1,%object; .size \1,\2; \1:/" \
-e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%function; \1:/" \