source: rtems/testsuites/libtests/dl09/init.c @ b36c5209

Last change on this file since b36c5209 was b36c5209, checked in by Chris Johns <chrisj@…>, on May 3, 2019 at 12:15:20 AM

libdl: Do not access the ELF file while the allocator is locked.

  • Load symbols before allocation.
  • Parse reloc records and place any reloc recs in a cache to use while the allocator is locked.
  • Relocate symbols after section allocation.
  • Split section loading into allocation/locating and loading.
  • Update all arch back-ends with a new reloc interface to control tramp handling.
  • Add -a and -t to the object list shell command.

Closes #3741

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>.  All rights reserved.
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9#ifdef HAVE_CONFIG_H
10  #include "config.h"
11#endif
12
13#include "tmacros.h"
14
15#include <errno.h>
16#include <string.h>
17#include <stdint.h>
18#include <unistd.h>
19
20#include <rtems/rtl/rtl.h>
21#include <rtems/untar.h>
22
23#include "dl-load.h"
24
25const char rtems_test_name[] = "libdl (RTL) 9";
26
27/* forward declarations to avoid warnings */
28static rtems_task Init(rtems_task_argument argument);
29
30#include "dl09-tar.h"
31
32#define TARFILE_START dl09_tar
33#define TARFILE_SIZE  dl09_tar_size
34
35static int test(void)
36{
37  int ret;
38  ret = dl_load_test();
39  if (ret)
40    rtems_test_exit(ret);
41  return 0;
42}
43
44static void Init(rtems_task_argument arg)
45{
46  int te;
47  int i;
48
49  TEST_BEGIN();
50
51  te = Untar_FromMemory((void *)TARFILE_START, (size_t)TARFILE_SIZE);
52  if (te != 0)
53  {
54    printf("untar failed: %d\n", te);
55    rtems_test_exit(1);
56    exit (1);
57  }
58
59  for (i = 0; i < 4; ++i)
60  {
61    printf ("--------------------------------------------------\n");
62    printf (" Run: %d\n", i);
63    test();
64  }
65
66  TEST_END();
67
68  rtems_test_exit(0);
69}
70
71#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
72#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
73
74#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
75
76#define CONFIGURE_MAXIMUM_TASKS 1
77
78#define CONFIGURE_MAXIMUM_SEMAPHORES 1
79
80#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
81
82#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
83
84#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U)
85
86#define CONFIGURE_INIT_TASK_ATTRIBUTES   (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
87
88#define CONFIGURE_INIT
89
90#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.