Blame sysdeps/x86_64/tst-split-dynreloc.c

Packit 6c4009
/* This test will be used to create an executable with a specific
Packit 6c4009
   section layout in which .rela.dyn and .rela.plt are not contiguous.
Packit 6c4009
   For x86 case, readelf will report something like:
Packit 6c4009
Packit 6c4009
   ...
Packit 6c4009
   [10] .rela.dyn         RELA
Packit 6c4009
   [11] .bar              PROGBITS
Packit 6c4009
   [12] .rela.plt         RELA
Packit 6c4009
   ...
Packit 6c4009
Packit 6c4009
   This is important as this case was not correctly handled by dynamic
Packit 6c4009
   linker in the bind-now case, and the second section was never
Packit 6c4009
   processed.  */
Packit 6c4009
Packit 6c4009
#include <stdio.h>
Packit 6c4009
Packit 6c4009
const int __attribute__ ((section(".bar"))) bar = 0x12345678;
Packit 6c4009
static const char foo[] = "foo";
Packit 6c4009
Packit 6c4009
static int
Packit 6c4009
do_test (void)
Packit 6c4009
{
Packit 6c4009
  printf ("%s %d\n", foo, bar);
Packit 6c4009
  return 0;
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
#define TEST_FUNCTION do_test ()
Packit 6c4009
#include "../test-skeleton.c"