c45bd4fd43
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.
12 lines
301 B
C
12 lines
301 B
C
extern void abort (void);
|
|
|
|
/* Since GCC 5 folds symbol address comparison, assuming each symbol has
|
|
different address, &foo == &bar is always false for GCC 5. Use
|
|
check_ptr_eq to check if 2 addresses are the same. */
|
|
|
|
void
|
|
check_ptr_eq (void *p1, void *p2)
|
|
{
|
|
if (p1 != p2)
|
|
abort ();
|
|
}
|