diff options
author | Chris Metcalf <cmetcalf@ezchip.com> | 2016-01-20 14:59:12 -0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-04-13 16:11:09 +0800 |
commit | 43ff2aeb8a86611189813ccf3b428742ef9e78db (patch) | |
tree | fa99b9422a2df137424e931381ded1dcf21482f2 | |
parent | 34dd2e8ee4025f0f4e14360825ca7d3582113650 (diff) | |
download | linux-linaro-stable-43ff2aeb8a86611189813ccf3b428742ef9e78db.tar.gz |
lib/clz_tab.c: put in lib-y rather than obj-y
The clz table (__clz_tab) in lib/clz_tab.c is also provided as part of
libgcc.a, and many architectures link against libgcc. To allow the
linker to avoid a multiple-definition link failure, clz_tab.o has to be
in lib/lib.a rather than lib/builtin.o. The specific issue is that
libgcc.a comes before lib/builtin.o on vmlinux.o's link command line, so
its _clz.o is pulled to satisfy __clz_tab, and then when the remainder
of lib/builtin.o is pulled in to satisfy all the other dependencies, the
__clz_tab symbols conflict. By putting clz_tab.o in lib.a, the linker
can simply avoid pulling it into vmlinux.o when this situation arises.
The definitions of __clz_tab are the same in libgcc.a and in the kernel;
arguably we could also simply rename the kernel version, but it's
unlikely the libgcc version will ever change to become incompatible, so
just using it seems reasonably safe.
Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit f5948701891322770ad6ede317da5fc9cf33d2f0)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r-- | lib/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Makefile b/lib/Makefile index 211fa14f08aa..de5c0b494761 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -143,7 +143,7 @@ obj-$(CONFIG_GLOB) += glob.o obj-$(CONFIG_MPILIB) += mpi/ obj-$(CONFIG_SIGNATURE) += digsig.o -obj-$(CONFIG_CLZ_TAB) += clz_tab.o +lib-$(CONFIG_CLZ_TAB) += clz_tab.o obj-$(CONFIG_DDR) += jedec_ddr_data.o |