Check address of versined symbol
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 27 Jul 2015 17:04:31 +0000 (10:04 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 27 Jul 2015 17:11:33 +0000 (10:11 -0700)
commitc45bd4fd43e5eb0cbad8ec410504e4778c64c65d
tree437332c0c8c52ca84beec235a45c479088aa01a2
parent077836f7cf6725386c01ae3bb7111663b8f2b85e
Check address of versined symbol

Since GCC 5 folds symbol address comparison, assuming each symbol has a
different address, &foo == &bar is always false for GCC 5.  This patch
adds check_ptr_eq if 2 addresses are the same and uses it to check the
address of versined symbol.

PR ld/18718
* ld-elf/check-ptr-eq.c: New file.
* ld-elf/pr18718.c (main): Call check_ptr_eq.
* ld-elf/shared.exp: Add check-ptr-eq.c to PR ld/18718 tests.
ld/testsuite/ld-elf/check-ptr-eq.c [new file with mode: 0644]
ld/testsuite/ld-elf/pr18718.c
ld/testsuite/ld-elf/shared.exp