Changeset 6c9f017 in rtems


Ignore:
Timestamp:
Feb 2, 2019, 4:09:53 AM (3 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
eec706e2
Parents:
194eb403
git-author:
Chris Johns <chrisj@…> (02/02/19 04:09:53)
git-committer:
Chris Johns <chrisj@…> (02/08/19 23:06:34)
Message:

libdl: Add powerpc large memory and small data support.

  • Add support for architecure sections that can be handled by the architecture back end.
  • Add trampoline/fixup support for PowerPC. This means the PowerPC now supports large memory loading of applications.
  • Add a bit allocator to manage small block based regions of memory.
  • Add small data (sdata/sbss) support for the PowerPC. The support makes the linker allocated small data region of memory a global resource available to libdl loaded object files.

Updates #3687
Updates #3685

Files:
4 added
51 edited

Legend:

Unmodified
Added
Removed
  • bsps/powerpc/psim/start/linkcmds

    r194eb403 r6c9f017  
    3939
    4040/*
    41  * Allocate the maximum memory to the sdata/sbss section.
     41 * Allocate the maximum size to the small data sdata/sbss section.
    4242 */
    43 bsp_section_sdata_bss_maximum_size = 1;
     43bsp_section_set_sdata_sbss_size = 65536;
    4444
    4545INCLUDE linkcmds.base
  • bsps/powerpc/qoriq/start/linkcmds.qoriq_e500

    r194eb403 r6c9f017  
    3636qoriq = 0xffe00000;
    3737
     38/*
     39 * Allocate the maximum size to the small data sdata/sbss section.
     40 */
     41bsp_section_set_sdata_sbss_size = 65536;
     42
    3843INCLUDE linkcmds.base
  • bsps/powerpc/qoriq/start/linkcmds.qoriq_e6500_32

    r194eb403 r6c9f017  
    3939qoriq_qman_portal = 0xff6000000;
    4040
     41/*
     42 * Allocate the maximum size to the small data sdata/sbss section.
     43 */
     44bsp_section_set_sdata_sbss_size = 65536;
     45
    4146INCLUDE linkcmds.base
  • bsps/powerpc/shared/start/linkcmds.base

    r194eb403 r6c9f017  
    294294        } > REGION_DATA AT > REGION_DATA_LOAD
    295295        .sdata : ALIGN_WITH_INPUT {
     296                bsp_section_sdata_begin = .;
    296297                PROVIDE (_SDA_BASE_ = 32768);
    297298                *(.sdata .sdata.* .gnu.linkonce.s.*)
     299                bsp_section_sdata_end = .;
    298300                bsp_section_data_end = .;
    299301        } > REGION_DATA AT > REGION_DATA_LOAD
     302        bsp_section_sdata_size = bsp_section_sdata_end - bsp_section_sdata_begin;
    300303        bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
    301304        bsp_section_data_load_begin = LOADADDR (.data);
    302305        bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
    303306
     307        /*
     308         * Set bsp_section_set_sdata_bss_size to the system's sdata and bss data size, eg:
     309         *
     310         *  bsp_section_set_sdata_sbss_size = 65536;
     311         */
     312        bsp_section_sdata_sbss_size = DEFINED(bsp_section_set_sdata_sbss_size) ?
     313                                                        bsp_section_set_sdata_sbss_size : 0;
    304314        .sbss : ALIGN_WITH_INPUT {
    305315                bsp_section_sbss_begin = .;
     
    308318                *(.scommon)
    309319                bsp_section_sbss_end = .;
     320                bsp_section_sdata_libdl_begin = .;
     321                . += bsp_section_sdata_sbss_size - (bsp_section_sdata_size + bsp_section_sbss_size);
     322                bsp_section_sdata_libdl_end = .;
    310323        } > REGION_DATA AT > REGION_DATA
    311324        bsp_section_sbss_size = bsp_section_sbss_end - bsp_section_sbss_begin;
  • cpukit/Makefile.am

    r194eb403 r6c9f017  
    11421142librtemscpu_a_SOURCES += libdl/rtl-alloc-heap.c
    11431143librtemscpu_a_SOURCES += libdl/rtl-archive.c
     1144librtemscpu_a_SOURCES += libdl/rtl-bit-alloc.c
    11441145librtemscpu_a_SOURCES += libdl/rtl.c
    11451146librtemscpu_a_SOURCES += libdl/rtl-chain-iterator.c
  • cpukit/include/rtems/rtl/rtl-obj.h

    r194eb403 r6c9f017  
    8888 * Flags for the various section types.
    8989 */
    90 #define RTEMS_RTL_OBJ_SECT_TEXT  (1 << 0)  /**< Section holds program text. */
    91 #define RTEMS_RTL_OBJ_SECT_CONST (1 << 1)  /**< Section holds program text. */
    92 #define RTEMS_RTL_OBJ_SECT_DATA  (1 << 2)  /**< Section holds program data. */
    93 #define RTEMS_RTL_OBJ_SECT_BSS   (1 << 3)  /**< Section holds program bss. */
    94 #define RTEMS_RTL_OBJ_SECT_EH    (1 << 4)  /**< Section holds exception data. */
    95 #define RTEMS_RTL_OBJ_SECT_TLS   (1 << 5)  /**< Section holds TLS data. */
    96 #define RTEMS_RTL_OBJ_SECT_REL   (1 << 6)  /**< Section holds relocation recs. */
    97 #define RTEMS_RTL_OBJ_SECT_RELA  (1 << 7)  /**< Section holds reloc addend recs. */
    98 #define RTEMS_RTL_OBJ_SECT_SYM   (1 << 8)  /**< Section holds symbols. */
    99 #define RTEMS_RTL_OBJ_SECT_STR   (1 << 9)  /**< Section holds strings. */
    100 #define RTEMS_RTL_OBJ_SECT_ALLOC (1 << 10  /**< Section allocates runtime memory. */
    101 #define RTEMS_RTL_OBJ_SECT_LOAD  (1 << 11) /**< Section is loaded from object file. */
    102 #define RTEMS_RTL_OBJ_SECT_WRITE (1 << 12) /**< Section is writable, ie data. */
    103 #define RTEMS_RTL_OBJ_SECT_EXEC  (1 << 13) /**< Section is executable. */
    104 #define RTEMS_RTL_OBJ_SECT_ZERO  (1 << 14) /**< Section is preset to zero. */
    105 #define RTEMS_RTL_OBJ_SECT_LINK  (1 << 15) /**< Section is link-ordered. */
    106 #define RTEMS_RTL_OBJ_SECT_CTOR  (1 << 16) /**< Section contains constructors. */
    107 #define RTEMS_RTL_OBJ_SECT_DTOR  (1 << 17) /**< Section contains destructors. */
    108 #define RTEMS_RTL_OBJ_SECT_LOCD  (1 << 18) /**< Section has been located. */
     90#define RTEMS_RTL_OBJ_SECT_TEXT       (1 << 0)  /**< Section holds program text. */
     91#define RTEMS_RTL_OBJ_SECT_CONST      (1 << 1)  /**< Section holds program text. */
     92#define RTEMS_RTL_OBJ_SECT_DATA       (1 << 2)  /**< Section holds program data. */
     93#define RTEMS_RTL_OBJ_SECT_BSS        (1 << 3)  /**< Section holds program bss. */
     94#define RTEMS_RTL_OBJ_SECT_EH         (1 << 4)  /**< Section holds exception data. */
     95#define RTEMS_RTL_OBJ_SECT_TLS        (1 << 5)  /**< Section holds TLS data. */
     96#define RTEMS_RTL_OBJ_SECT_REL        (1 << 6)  /**< Section holds relocation recs. */
     97#define RTEMS_RTL_OBJ_SECT_RELA       (1 << 7)  /**< Section holds reloc addend recs. */
     98#define RTEMS_RTL_OBJ_SECT_SYM        (1 << 8)  /**< Section holds symbols. */
     99#define RTEMS_RTL_OBJ_SECT_STR        (1 << 9)  /**< Section holds strings. */
     100#define RTEMS_RTL_OBJ_SECT_ALLOC      (1 << 10  /**< Section allocates runtime memory. */
     101#define RTEMS_RTL_OBJ_SECT_LOAD       (1 << 11) /**< Section is loaded from object file. */
     102#define RTEMS_RTL_OBJ_SECT_WRITE      (1 << 12) /**< Section is writable, ie data. */
     103#define RTEMS_RTL_OBJ_SECT_EXEC       (1 << 13) /**< Section is executable. */
     104#define RTEMS_RTL_OBJ_SECT_ZERO       (1 << 14) /**< Section is preset to zero. */
     105#define RTEMS_RTL_OBJ_SECT_LINK       (1 << 15) /**< Section is link-ordered. */
     106#define RTEMS_RTL_OBJ_SECT_CTOR       (1 << 16) /**< Section contains constructors. */
     107#define RTEMS_RTL_OBJ_SECT_DTOR       (1 << 17) /**< Section contains destructors. */
     108#define RTEMS_RTL_OBJ_SECT_LOCD       (1 << 18) /**< Section has been located. */
     109#define RTEMS_RTL_OBJ_SECT_ARCH_ALLOC (1 << 19) /**< Section use arch allocator. */
    109110
    110111/**
     
    238239/**
    239240 * A section handler is called once for each section that needs to be
    240  * processed by this handler.
     241 * processed by this handler. The handler is specific to a task.
    241242 *
    242243 * @param obj The object file's descriptor the section belongs too.
     
    375376  return (obj->trampoline != NULL &&
    376377          ((obj->tramp_brk - obj->trampoline) + size) <= obj->tramp_size);
     378}
     379
     380/**
     381 * Does the section require architecture specific allocations?
     382 *
     383 * @param sect The section.
     384 * @retval bool Returns @true if the section requires arch allocation.
     385 */
     386static inline bool rtems_rtl_obj_sect_is_arch_alloc (rtems_rtl_obj_sect* sect)
     387{
     388  return (sect->flags & RTEMS_RTL_OBJ_SECT_ARCH_ALLOC) != 0;
    377389}
    378390
     
    730742
    731743/**
     744 * Allocate the sections. If a handler is provided (not NULL) it is called for
     745 * all section.
     746 *
     747 * @param obj The object file's descriptor.
     748 * @param fd The object file's file descriptor.
     749 * @param handler The object file's format specific allocation handler.
     750 * @param data User specific data handle.
     751 * @retval true The object has been sucessfully loaded.
     752 * @retval false The load failed. The RTL error has been set.
     753 */
     754bool
     755rtems_rtl_obj_alloc_sections (rtems_rtl_obj*             obj,
     756                              int                        fd,
     757                              rtems_rtl_obj_sect_handler handler,
     758                              void*                      data);
     759
     760/**
    732761 * Load the sections that have been allocated memory in the target. The bss
    733762 * type section does not load any data, it is set to 0. The text and data
  • cpukit/include/rtems/rtl/rtl-trace.h

    r194eb403 r6c9f017  
    5252#define RTEMS_RTL_TRACE_ARCHIVE_SYMS           (1UL << 13)
    5353#define RTEMS_RTL_TRACE_DEPENDENCY             (1UL << 14)
     54#define RTEMS_RTL_TRACE_BIT_ALLOC              (1UL << 15)
    5455#define RTEMS_RTL_TRACE_ALL                    (0xffffffffUL & ~(RTEMS_RTL_TRACE_CACHE | \
    5556                                                                 RTEMS_RTL_TRACE_GLOBAL_SYM | \
  • cpukit/libdl/rtl-archive.c

    r194eb403 r6c9f017  
    2222#include <errno.h>
    2323#include <fnmatch.h>
     24#include <inttypes.h>
    2425#include <stdio.h>
    2526#include <string.h>
     
    573574  rtems_chain_node* node;
    574575  if (rtems_rtl_trace (RTEMS_RTL_TRACE_ARCHIVES))
    575     printf ("rtl: archive: close: count=%ds\n",
     576    printf ("rtl: archive: close: count=%zu\n",
    576577            rtems_chain_node_count_unprotected (&archives->archives));
    577578  node = rtems_chain_first (&archives->archives);
     
    592593  rtems_chain_node* node = rtems_chain_first (&archives->archives);
    593594  if (rtems_rtl_trace (RTEMS_RTL_TRACE_ARCHIVES))
    594     printf ("rtl: archive: refresh: remove: checking %d archive(s)\n",
     595    printf ("rtl: archive: refresh: remove: checking %zu archive(s)\n",
    595596            rtems_chain_node_count_unprotected (&archives->archives));
    596597  while (!rtems_chain_is_tail (&archives->archives, node))
     
    717718                archive->symbols.entries,
    718719                archive->symbols.names,
    719                 (archive->symbols.entries + 1) * 4,
     720                (unsigned int) (archive->symbols.entries + 1) * 4,
    720721                archive->symbols.symbols);
    721722
  • cpukit/libdl/rtl-elf.c

    r194eb403 r6c9f017  
    475475  bool r = rtems_rtl_elf_relocate_worker (obj, fd, sect,
    476476                                          rtems_rtl_elf_reloc_parser, data);
    477   rtems_rtl_obj_update_flags (RTEMS_RTL_OBJ_RELOC_TAG, 0);
    478477  return r;
    479478}
     
    604603    {
    605604      if (rtems_rtl_trace (RTEMS_RTL_TRACE_SYMBOL))
    606         printf ("rtl: com:elf:%-2d bind:%-2d type:%-2d size:%d value:%d\n",
     605        printf ("rtl: com:elf:%-2d bind:%-2d type:%-2d size:%d value:%d name:%d\n",
    607606                sym, (int) ELF_ST_BIND (symbol.st_info),
    608607                (int) ELF_ST_TYPE (symbol.st_info),
    609                 (int) symbol.st_size, (int) symbol.st_value);
     608                (int) symbol.st_size, (int) symbol.st_value,
     609                (int) symbol.st_name);
    610610      /*
    611611       * If the size is zero this is the first entry, it defines the common
     
    954954
    955955static bool
     956rtems_rtl_elf_arch_alloc (rtems_rtl_obj*      obj,
     957                          int                 fd,
     958                          rtems_rtl_obj_sect* sect,
     959                          void*               data)
     960{
     961  if (rtems_rtl_obj_sect_is_arch_alloc (sect))
     962    return rtems_rtl_elf_arch_section_alloc (obj, sect);
     963  return true;
     964}
     965
     966static bool
     967rtems_rtl_elf_arch_free (rtems_rtl_obj* obj)
     968{
     969  int index = -1;
     970  while (true)
     971  {
     972    rtems_rtl_obj_sect* sect;
     973    sect = rtems_rtl_obj_find_section_by_mask (obj,
     974                                               index,
     975                                               RTEMS_RTL_OBJ_SECT_ARCH_ALLOC);
     976    if (sect == NULL)
     977      break;
     978    if (!rtems_rtl_elf_arch_section_free (obj, sect))
     979      return false;
     980    index = sect->section;
     981  }
     982  return true;
     983}
     984
     985static bool
    956986rtems_rtl_elf_loader (rtems_rtl_obj*      obj,
    957987                      int                 fd,
     
    11691199      }
    11701200
     1201      /*
     1202       * Architecture specific parsing. Modified or extends the flags.
     1203       */
     1204      flags = rtems_rtl_elf_arch_parse_section (obj, section, name, &shdr, flags);
     1205      if (flags == 0)
     1206      {
     1207        if (rtems_rtl_trace (RTEMS_RTL_TRACE_WARNING))
     1208          printf ("rtl: unsupported section: %2d: type=%02d flags=%02x\n",
     1209                  section, (int) shdr.sh_type, (int) shdr.sh_flags);
     1210        rtems_rtl_set_error (ENOMEM, "invalid architecture section: %s", name);
     1211        return false;
     1212      }
     1213
     1214      /*
     1215       * Add the section.
     1216       */
    11711217      if (!rtems_rtl_obj_add_section (obj, section, name,
    11721218                                      shdr.sh_size, shdr.sh_offset,
     
    14121458
    14131459  /*
     1460   * Allocate the sections.
     1461   */
     1462  if (!rtems_rtl_obj_alloc_sections (obj, fd, rtems_rtl_elf_arch_alloc, &ehdr))
     1463    return false;
     1464
     1465  /*
    14141466   * Load the sections and symbols and then relocation to the base address.
    14151467   */
     
    14541506rtems_rtl_elf_file_unload (rtems_rtl_obj* obj)
    14551507{
     1508  rtems_rtl_elf_arch_free (obj);
    14561509  rtems_rtl_elf_unwind_deregister (obj);
    14571510  return true;
  • cpukit/libdl/rtl-elf.h

    r194eb403 r6c9f017  
    7171/**
    7272 * Architecture specific handler to translate unknown section flags to RTL
    73  * section flags.
     73 * section flags. If this function returns 0 an error is raised.
    7474 *
    7575 * @param obj The object file being relocated.
     
    8080uint32_t rtems_rtl_elf_section_flags (const rtems_rtl_obj* obj,
    8181                                      const Elf_Shdr*      shdr);
     82
     83/**
     84 * Architecture specific handler to parse the section and add any flags that
     85 * may be need to handle the section.
     86 *
     87 * @param obj The object file being relocated.
     88 * @param seciton The section index.
     89 * @param name The name of the section
     90 * @param shdr The ELF section header.
     91 * @param flags The standard ELF parsed flags.
     92 * @retval uint32_t Extra RTL object file flags.
     93 */
     94uint32_t rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     95                                           int                  section,
     96                                           const char*          name,
     97                                           const Elf_Shdr*      shdr,
     98                                           const uint32_t       flags);
     99
     100/**
     101 * Architecture specific handler to allocate a section. Some sections are
     102 * specific to an architecture and need special allocators.
     103 *
     104 * @param obj The object file being relocated.
     105 * @param sect The section data.
     106 * @retval true The allocator was successful.
     107 */
     108bool rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     109                                       rtems_rtl_obj_sect* sect);
     110
     111/**
     112 * Architecture specific handler to free a section. Some sections are
     113 * specific to an architecture and need special allocators.
     114 *
     115 * @param obj The object file being relocated.
     116 * @param sect The section data.
     117 * @retval true The allocator was successful.
     118 */
     119bool rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     120                                      rtems_rtl_obj_sect* sect);
    82121
    83122/**
  • cpukit/libdl/rtl-error.c

    r194eb403 r6c9f017  
    4545  {
    4646    int last_errno = rtl->last_errno;
     47    rtl->last_errno = 0;
    4748    strlcpy (message, rtl->last_error, max_message);
    4849    rtems_rtl_unlock ();
  • cpukit/libdl/rtl-mdreloc-arm.c

    r194eb403 r6c9f017  
    110110}
    111111
     112uint32_t
     113rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     114                                  int                  section,
     115                                  const char*          name,
     116                                  const Elf_Shdr*      shdr,
     117                                  const uint32_t       flags)
     118{
     119  (void) obj;
     120  (void) section;
     121  (void) name;
     122  (void) shdr;
     123  return flags;
     124}
     125
     126bool
     127rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     128                                  rtems_rtl_obj_sect*  sect)
     129{
     130  (void) obj;
     131  (void) sect;
     132  return false;
     133}
     134
     135bool
     136rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     137                                  rtems_rtl_obj_sect*  sect)
     138{
     139  (void) obj;
     140  (void) sect;
     141  return false;
     142}
     143
    112144bool
    113145rtems_rtl_elf_rel_resolve_sym (Elf_Word type)
     
    153185
    154186static bool
    155 rtems_rtl_elf_relor_rel (rtems_rtl_obj*            obj,
     187rtems_rtl_elf_reloc_rel (rtems_rtl_obj*            obj,
    156188                         const Elf_Rel*            rel,
    157189                         const rtems_rtl_obj_sect* sect,
     
    494526                                  const Elf_Word            symvalue)
    495527{
    496   return rtems_rtl_elf_relor_rel (obj,
     528  return rtems_rtl_elf_reloc_rel (obj,
    497529                                  rel,
    498530                                  sect,
     
    511543                            const Elf_Word            symvalue)
    512544{
    513   return rtems_rtl_elf_relor_rel (obj,
     545  return rtems_rtl_elf_reloc_rel (obj,
    514546                                  rel,
    515547                                  sect,
  • cpukit/libdl/rtl-mdreloc-bfin.c

    r194eb403 r6c9f017  
    1717}
    1818
     19uint32_t
     20rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     21                                  int                  section,
     22                                  const char*          name,
     23                                  const Elf_Shdr*      shdr,
     24                                  const uint32_t       flags)
     25{
     26  (void) obj;
     27  (void) section;
     28  (void) name;
     29  (void) shdr;
     30  return flags;
     31}
     32
     33bool
     34rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     35                                  rtems_rtl_obj_sect*  sect)
     36{
     37  (void) obj;
     38  (void) sect;
     39  return false;
     40}
     41
     42bool
     43rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     44                                  rtems_rtl_obj_sect*  sect)
     45{
     46  (void) obj;
     47  (void) sect;
     48  return false;
     49}
     50
    1951bool
    2052rtems_rtl_elf_rel_resolve_sym (Elf_Word type)
  • cpukit/libdl/rtl-mdreloc-h8300.c

    r194eb403 r6c9f017  
    1818{
    1919  return 0;
     20}
     21
     22uint32_t
     23rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     24                                  int                  section,
     25                                  const char*          name,
     26                                  const Elf_Shdr*      shdr,
     27                                  const uint32_t       flags)
     28{
     29  (void) obj;
     30  (void) section;
     31  (void) name;
     32  (void) shdr;
     33  return flags;
     34}
     35
     36bool
     37rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     38                                  rtems_rtl_obj_sect*  sect)
     39{
     40  (void) obj;
     41  (void) sect;
     42  return false;
     43}
     44
     45bool
     46rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     47                                  rtems_rtl_obj_sect*  sect)
     48{
     49  (void) obj;
     50  (void) sect;
     51  return false;
    2052}
    2153
  • cpukit/libdl/rtl-mdreloc-i386.c

    r194eb403 r6c9f017  
    2525{
    2626  return 0;
     27}
     28
     29uint32_t
     30rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     31                                  int                  section,
     32                                  const char*          name,
     33                                  const Elf_Shdr*      shdr,
     34                                  const uint32_t       flags)
     35{
     36  (void) obj;
     37  (void) section;
     38  (void) name;
     39  (void) shdr;
     40  return flags;
     41}
     42
     43bool
     44rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     45                                  rtems_rtl_obj_sect*  sect)
     46{
     47  (void) obj;
     48  (void) sect;
     49  return false;
     50}
     51
     52bool
     53rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     54                                  rtems_rtl_obj_sect*  sect)
     55{
     56  (void) obj;
     57  (void) sect;
     58  return false;
    2759}
    2860
  • cpukit/libdl/rtl-mdreloc-lm32.c

    r194eb403 r6c9f017  
    1818{
    1919  return 0;
     20}
     21
     22uint32_t
     23rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     24                                  int                  section,
     25                                  const char*          name,
     26                                  const Elf_Shdr*      shdr,
     27                                  const uint32_t       flags)
     28{
     29  (void) obj;
     30  (void) section;
     31  (void) name;
     32  (void) shdr;
     33  return flags;
     34}
     35
     36bool
     37rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     38                                  rtems_rtl_obj_sect*  sect)
     39{
     40  (void) obj;
     41  (void) sect;
     42  return false;
     43}
     44
     45bool
     46rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     47                                  rtems_rtl_obj_sect*  sect)
     48{
     49  (void) obj;
     50  (void) sect;
     51  return false;
    2052}
    2153
  • cpukit/libdl/rtl-mdreloc-m68k.c

    r194eb403 r6c9f017  
    3838{
    3939  return 0;
     40}
     41
     42uint32_t
     43rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     44                                  int                  section,
     45                                  const char*          name,
     46                                  const Elf_Shdr*      shdr,
     47                                  const uint32_t       flags)
     48{
     49  (void) obj;
     50  (void) section;
     51  (void) name;
     52  (void) shdr;
     53  return flags;
     54}
     55
     56bool
     57rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     58                                  rtems_rtl_obj_sect*  sect)
     59{
     60  (void) obj;
     61  (void) sect;
     62  return false;
     63}
     64
     65bool
     66rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     67                                  rtems_rtl_obj_sect*  sect)
     68{
     69  (void) obj;
     70  (void) sect;
     71  return false;
    4072}
    4173
     
    157189
    158190                default:
    159       printf ("rtl: reloc unknown: sym = %lu, type = %lu, offset = %p, "
     191      printf ("rtl: reloc unknown: sym = %u, type = %u, offset = %p, "
    160192              "contents = %p\n",
    161193              ELF_R_SYM(rela->r_info), (uint32_t) ELF_R_TYPE(rela->r_info),
    162194              (void *)rela->r_offset, (void *)*where);
    163195      rtems_rtl_set_error (EINVAL,
    164                            "%s: Unsupported relocation type %ld "
     196                           "%s: Unsupported relocation type %d "
    165197                           "in non-PLT relocations",
    166198                           sect->name, (uint32_t) ELF_R_TYPE(rela->r_info));
  • cpukit/libdl/rtl-mdreloc-mips.c

    r194eb403 r6c9f017  
    1818{
    1919  return 0;
     20}
     21
     22uint32_t
     23rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     24                                  int                  section,
     25                                  const char*          name,
     26                                  const Elf_Shdr*      shdr,
     27                                  const uint32_t       flags)
     28{
     29  (void) obj;
     30  (void) section;
     31  (void) name;
     32  (void) shdr;
     33  return flags;
     34}
     35
     36bool
     37rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     38                                  rtems_rtl_obj_sect*  sect)
     39{
     40  (void) obj;
     41  (void) sect;
     42  return false;
     43}
     44
     45bool
     46rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     47                                  rtems_rtl_obj_sect*  sect)
     48{
     49  (void) obj;
     50  (void) sect;
     51  return false;
    2052}
    2153
  • cpukit/libdl/rtl-mdreloc-moxie.c

    r194eb403 r6c9f017  
    1919{
    2020  return 0;
     21}
     22
     23uint32_t
     24rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     25                                  int                  section,
     26                                  const char*          name,
     27                                  const Elf_Shdr*      shdr,
     28                                  const uint32_t       flags)
     29{
     30  (void) obj;
     31  (void) section;
     32  (void) name;
     33  (void) shdr;
     34  return flags;
     35}
     36
     37bool
     38rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     39                                  rtems_rtl_obj_sect*  sect)
     40{
     41  (void) obj;
     42  (void) sect;
     43  return false;
     44}
     45
     46bool
     47rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     48                                  rtems_rtl_obj_sect*  sect)
     49{
     50  (void) obj;
     51  (void) sect;
     52  return false;
    2153}
    2254
  • cpukit/libdl/rtl-mdreloc-powerpc.c

    r194eb403 r6c9f017  
    1414
    1515#include <rtems/rtl/rtl.h>
     16#include "rtl-bit-alloc.h"
    1617#include "rtl-elf.h"
    1718#include "rtl-error.h"
     
    2425#define l(x) ((u_int32_t)(x) & 0xffff)
    2526
     27/*
     28 * SDATA allocator.
     29 */
     30static rtems_rtl_bit_alloc* sdata;
     31
     32static Elf_Addr
     33get_sda_base (void)
     34{
     35  uint32_t sda_base;
     36  __asm__ volatile (" mr %0, 13\n" : "=r" (sda_base));
     37  return sda_base;
     38}
     39
     40/*
     41 *  Access the variables via asm statements to avoid any fix up issues
     42 *  generated by the C compiler which thinks they belong in the .sdata
     43 *  section.
     44 */
     45
     46#define GET_ADDR(_l, _v) \
     47  __asm__ volatile (" lis %0, " #_l "@h\n" \
     48                    " ori %0, %0, " #_l "@l\n" : "=r" (_v))
     49
     50static void*
     51get_sdata_start (void)
     52{
     53  Elf_Addr addr;
     54  GET_ADDR(__SDATA_START__, addr);
     55  return (void*) addr;
     56}
     57
     58static size_t
     59get_sdata_sbss_size (void)
     60{
     61  Elf_Addr sdata_begin;
     62  Elf_Addr sbss_end;
     63  GET_ADDR(bsp_section_sdata_begin, sdata_begin);
     64  GET_ADDR(bsp_section_sbss_end, sbss_end);
     65  return sbss_end - sdata_begin;
     66}
     67
     68static size_t
     69get_sdata_libdl_size (void)
     70{
     71  Elf_Addr begin;
     72  Elf_Addr end;
     73  GET_ADDR(bsp_section_sdata_libdl_begin, begin);
     74  GET_ADDR(bsp_section_sdata_libdl_end, end);
     75  return end - begin;
     76}
     77
    2678uint32_t
    2779rtems_rtl_elf_section_flags (const rtems_rtl_obj* obj,
     
    3183}
    3284
     85uint32_t
     86rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     87                                  int                  section,
     88                                  const char*          name,
     89                                  const Elf_Shdr*      shdr,
     90                                  const uint32_t       flags)
     91{
     92  struct {
     93    const char* label;
     94    size_t      len;
     95  } prefix[] = {
     96    #define SEPARATED_PREFIX(_p) { _p, sizeof (_p) - 1 }
     97    SEPARATED_PREFIX (".sdata"),
     98    SEPARATED_PREFIX (".sbss"),
     99  };
     100  const size_t prefixes = sizeof (prefix) / sizeof (prefix[0]);
     101  size_t       p;
     102  for (p = 0; p < prefixes; ++p)
     103  {
     104    if (strncmp (name, prefix[p].label, prefix[p].len) == 0)
     105      return flags | RTEMS_RTL_OBJ_SECT_ARCH_ALLOC;
     106  }
     107  return flags;
     108}
     109
     110bool
     111rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     112                                  rtems_rtl_obj_sect*  sect)
     113{
     114  if (rtems_rtl_trace (RTEMS_RTL_TRACE_DETAIL))
     115    printf ("rtl: section: arch: alloc: name=%s size=%zu flags=%08" PRIx32 \
     116            " order=%i link=%d info=%d\n",
     117            sect->name, sect->size, sect->flags, sect->load_order,
     118            sect->link, sect->info);
     119
     120  if (sdata == NULL)
     121  {
     122    sdata = rtems_rtl_bit_alloc_open (get_sdata_start (),
     123                                      get_sdata_libdl_size (),
     124                                      sizeof (uint32_t),
     125                                      get_sdata_sbss_size ());
     126    if (sdata == NULL)
     127    {
     128      rtems_rtl_set_error (ENOMEM, "no memory for sdata allocator");
     129      return false;
     130    }
     131  }
     132
     133  sect->base = rtems_rtl_bit_alloc_balloc (sdata, sect->size);
     134  if (sect->base == NULL)
     135  {
     136    rtems_rtl_set_error (ENOMEM, "no .sdata memory: %s", sect->name);
     137    return false;
     138  }
     139
     140  return true;
     141}
     142
     143bool
     144rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     145                                  rtems_rtl_obj_sect*  sect)
     146{
     147  if (rtems_rtl_trace (RTEMS_RTL_TRACE_DETAIL))
     148    printf ("rtl: section: arch: free: name=%s size=%zu\n", sect->name, sect->size);
     149  if (sdata != NULL)
     150    rtems_rtl_bit_alloc_bfree (sdata, sect->base, sect->size);
     151  return true;
     152}
     153
    33154bool
    34155rtems_rtl_elf_rel_resolve_sym (Elf_Word type)
     
    41162{
    42163  /*
    43    * Disable by returning 0.
     164   * We have 4 instructions and each instruction is 32bits.
    44165   */
    45   return 0;
    46 }
    47 
    48 bool
    49 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj*            obj,
    50                                    const Elf_Rela*           rela,
    51                                    const rtems_rtl_obj_sect* sect,
    52                                    const char*               symname,
    53                                    const Elf_Byte            syminfo,
    54                                    const Elf_Word            symvalue)
    55 {
    56   (void) obj;
    57   (void) rela;
    58   (void) sect;
    59   (void) symname;
    60   (void) syminfo;
    61   (void) symvalue;
    62   return true;
    63 }
    64 
    65 bool
    66 rtems_rtl_elf_relocate_rela (rtems_rtl_obj*            obj,
    67                              const Elf_Rela*           rela,
    68                              const rtems_rtl_obj_sect* sect,
    69                              const char*               symname,
    70                              const Elf_Byte            syminfo,
    71                              const Elf_Word            symvalue)
     166  return 4 * 4;
     167}
     168
     169static void*
     170set_veneer (void* tramopline, Elf_Addr target)
     171{
     172  /*
     173   * http://shell-storm.org/online/Online-Assembler-and-Disassembler/
     174   *
     175   *  lis   12,0x1234
     176   *  ori   12,12,0x5678
     177   *  mtctr 12
     178   *  bctr
     179   */
     180#if COMPILE_ASM
     181  asm volatile (" lis   12,0x1234\n" \
     182                " ori   12,12,0x5678\n" \
     183                " mtctr 12\n" \
     184                " bctr\n");
     185#endif
     186  uint32_t* tramp = (uint32_t*) tramopline;
     187  *tramp++ = 0x3d800000 | (target >> 16);
     188  *tramp++ = 0x618c0000 | (target & 0xffff);
     189  *tramp++ = 0x7d8903a6;
     190  *tramp++ = 0x4e800420;
     191  return tramp;
     192}
     193
     194static size_t
     195get_veneer_size (int type)
     196{
     197  (void) type;
     198  return rtems_rtl_elf_relocate_tramp_max_size ();
     199}
     200
     201static bool
     202rtems_rtl_elf_reloc_rela (rtems_rtl_obj*            obj,
     203                          const Elf_Rela*           rela,
     204                          const rtems_rtl_obj_sect* sect,
     205                          const char*               symname,
     206                          const Elf_Byte            syminfo,
     207                          const Elf_Word            symvalue,
     208                          const bool                parsing)
    72209{
    73210  Elf_Addr* where;
     
    85222       * value:1; Field: word32; Expression: S + A
    86223       */
    87       *where = symvalue + rela->r_addend;
    88       if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
    89         printf ("rtl: ADDR32 %p @ %p in %s\n",
    90                 (void *)*(where), where, rtems_rtl_obj_oname (obj));
     224      if (!parsing) {
     225        *where = symvalue + rela->r_addend;
     226        if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
     227          printf ("rtl: ADDR32 %p @ %p in %s\n",
     228                  (void *)*(where), where, rtems_rtl_obj_oname (obj));
     229      }
    91230      break;
    92231
     
    108247      tmp = (symvalue + rela->r_addend) >> 2;
    109248      if (tmp > ((1<<bits) - 1 )) {
    110         printf("Overflow ADDR14/ADDR24\n");
    111         return false;
    112       }
    113       tmp = *where;
    114       tmp &= ~mask;
    115       tmp |= (symvalue + rela->r_addend) & mask;
    116       *where = tmp;
    117       if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
    118         printf ("rtl: ADDR14/ADDR24 %p @ %p in %s\n",
    119                 (void *)*where, where, rtems_rtl_obj_oname (obj));
     249        Elf_Word tramp_addr;
     250        size_t   tramp_size = get_veneer_size(ELF_R_TYPE(rela->r_info));
     251        if (parsing) {
     252          obj->tramp_size += tramp_size;
     253          return true;
     254        }
     255        tramp_addr = (Elf_Addr) obj->tramp_brk;
     256        obj->tramp_brk = set_veneer(obj->tramp_brk,
     257                                    symvalue + rela->r_addend);
     258        tmp = *where;
     259        tmp &= ~mask;
     260        tmp |= (tramp_addr + rela->r_addend) & mask;
     261      }
     262      else {
     263        tmp = *where;
     264        tmp &= ~mask;
     265        tmp |= (symvalue + rela->r_addend) & mask;
     266      }
     267
     268      if (!parsing) {
     269        *where = tmp;
     270        if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
     271          printf ("rtl: ADDR14/ADDR24 %p @ %p in %s\n",
     272                  (void *)*where, where, rtems_rtl_obj_oname (obj));
     273      }
    120274      break;
    121275
     
    124278       * value:6; Field:half16; Expression: #ha(S+A)
    125279       */
    126 
    127       tmp = symvalue + rela->r_addend;
    128       *(uint16_t *)where = (((tmp >> 16) + ((tmp & 0x8000) ? 1: 0)) & 0xffff);
    129       if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
    130         printf ("rtl: 16_HA %p @ %p in %s\n",
    131                 (void *)*(where), where, rtems_rtl_obj_oname (obj));
     280      if (!parsing) {
     281        tmp = symvalue + rela->r_addend;
     282        *(uint16_t *)where = (((tmp >> 16) + ((tmp & 0x8000) ? 1: 0)) & 0xffff);
     283        if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
     284          printf ("rtl: 16_HA %p @ %p in %s\n",
     285                  (void *)*(where), where, rtems_rtl_obj_oname (obj));
     286      }
    132287      break;
    133288
     
    136291       * value:5; Field:half16; Expression: #hi(S+A)
    137292       */
    138       *(uint16_t *)where = ((symvalue + rela->r_addend) >> 16) & 0xffff;
    139       if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
    140         printf ("rtl: 16_HI %p @ %p in %s\n",
    141                 (void *)*where, where, rtems_rtl_obj_oname (obj));
     293      if (!parsing) {
     294        *(uint16_t *)where = ((symvalue + rela->r_addend) >> 16) & 0xffff;
     295        if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
     296          printf ("rtl: 16_HI %p @ %p in %s\n",
     297                  (void *)*where, where, rtems_rtl_obj_oname (obj));
     298      }
    142299      break;
    143300    case R_TYPE(16_LO):
     
    145302       * value:4; Field:half16; Expression: #lo(S+A)
    146303       */
    147       *(uint16_t *)where = (symvalue + (rela->r_addend)) & 0xffff;
    148       if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
    149         printf ("rtl: 16_LO %p @ %p in %s\n",
    150                 (void *)*where, where, rtems_rtl_obj_oname (obj));
     304      if (!parsing) {
     305        *(uint16_t *)where = (symvalue + (rela->r_addend)) & 0xffff;
     306        if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
     307          printf ("rtl: 16_LO %p @ %p in %s\n",
     308                  (void *)*where, where, rtems_rtl_obj_oname (obj));
     309      }
    151310      break;
    152311
     
    171330      if (((Elf_Sword)tmp > ((1<<(bits-1)) - 1)) ||
    172331          ((Elf_Sword)tmp < -(1<<(bits-1)))) {
    173         printf("Overflow REL14/REL24\n");
    174         return false;
    175       }
    176 
    177       tmp = *where;
    178       tmp &= ~mask;
    179       tmp |= (symvalue + rela->r_addend - (Elf_Addr)where) & mask;
    180       *where = tmp;
    181       if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
    182         printf ("rtl: REL24/REL14 %p @ %p in %s\n",
    183                 (void *)*where, where, rtems_rtl_obj_oname (obj));
     332        Elf_Word tramp_addr;
     333        size_t   tramp_size = get_veneer_size(ELF_R_TYPE(rela->r_info));
     334        if (parsing) {
     335          obj->tramp_size += tramp_size;
     336          return true;
     337        }
     338        tramp_addr = (Elf_Addr) obj->tramp_brk;
     339        obj->tramp_brk = set_veneer(obj->tramp_brk,
     340                                    symvalue + rela->r_addend);
     341        tmp = *where;
     342        tmp &= ~mask;
     343        tmp |= (tramp_addr + rela->r_addend - (Elf_Addr)where) & mask;
     344      }
     345      else
     346      {
     347        tmp = *where;
     348        tmp &= ~mask;
     349        tmp |= (symvalue + rela->r_addend - (Elf_Addr)where) & mask;
     350      }
     351
     352      if (!parsing) {
     353        *where = tmp;
     354        if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
     355          printf ("rtl: REL24/REL14 %p @ %p in %s\n",
     356                  (void *)*where, where, rtems_rtl_obj_oname (obj));
     357      }
    184358      break;
    185359
     
    188362       * value:26; Field:word32*; Expression:S+A-P
    189363       */
    190       *where = symvalue + rela->r_addend - (Elf_Addr)where;
    191       if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
    192         printf ("rtl: REL32 %p @ %p in %s\n",
    193                 (void *)*where, where, rtems_rtl_obj_oname (obj));
     364      if (!parsing) {
     365        *where = symvalue + rela->r_addend - (Elf_Addr)where;
     366        if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
     367          printf ("rtl: REL32 %p @ %p in %s\n",
     368                  (void *)*where, where, rtems_rtl_obj_oname (obj));
     369      }
    194370      break;
    195371
     
    199375       * small data items.
    200376       */
    201       mask = 0xffff;
    202       tmp = *((Elf32_Half*) where);
    203       tmp &= ~mask;
    204       tmp |= (symvalue + rela->r_addend - (Elf_Addr)where) & mask;
    205       *((Elf32_Half*) where) = tmp;
    206       if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
    207         printf ("rtl: SDAREL16 %p @ %p in %s\n",
    208                 (void *) (uintptr_t) *((Elf32_Half*) where),
    209                 where, rtems_rtl_obj_oname (obj));
     377      if (!parsing) {
     378        Elf_Addr sda_base = get_sda_base ();
     379        mask = 0xffff;
     380        tmp = *((Elf32_Half*) where);
     381        tmp &= ~mask;
     382        tmp |= (symvalue + rela->r_addend - sda_base) & mask;
     383        *((Elf32_Half*) where) = tmp;
     384        if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
     385          printf ("rtl: SDAREL16 %p @ %p in %s\n",
     386                  (void *) (uintptr_t) *((Elf32_Half*) where),
     387                  where, rtems_rtl_obj_oname (obj));
     388      }
    210389      break;
    211390
    212391    default:
    213       printf ("rtl: reloc unknown: sym = %lu, type = %" PRIu32 ", offset = %p, "
     392      printf ("rtl: reloc unknown: sym = %" PRIu32 ", type = %" PRIu32 ", offset = %p, "
    214393              "contents = %p\n",
    215394              ELF_R_SYM(rela->r_info), (uint32_t) ELF_R_TYPE(rela->r_info),
     
    225404
    226405bool
     406rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj*            obj,
     407                                   const Elf_Rela*           rela,
     408                                   const rtems_rtl_obj_sect* sect,
     409                                   const char*               symname,
     410                                   const Elf_Byte            syminfo,
     411                                   const Elf_Word            symvalue)
     412{
     413  return rtems_rtl_elf_reloc_rela (obj,
     414                                   rela,
     415                                   sect,
     416                                   symname,
     417                                   syminfo,
     418                                   symvalue,
     419                                   true);
     420}
     421
     422bool
     423rtems_rtl_elf_relocate_rela (rtems_rtl_obj*            obj,
     424                             const Elf_Rela*           rela,
     425                             const rtems_rtl_obj_sect* sect,
     426                             const char*               symname,
     427                             const Elf_Byte            syminfo,
     428                             const Elf_Word            symvalue)
     429{
     430  return rtems_rtl_elf_reloc_rela (obj,
     431                                   rela,
     432                                   sect,
     433                                   symname,
     434                                   syminfo,
     435                                   symvalue,
     436                                   false);
     437}
     438
     439bool
    227440rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj*            obj,
    228441                                  const Elf_Rel*            rel,
  • cpukit/libdl/rtl-mdreloc-sparc.c

    r194eb403 r6c9f017  
    139139}
    140140
     141uint32_t
     142rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     143                                  int                  section,
     144                                  const char*          name,
     145                                  const Elf_Shdr*      shdr,
     146                                  const uint32_t       flags)
     147{
     148  (void) obj;
     149  (void) section;
     150  (void) name;
     151  (void) shdr;
     152  return flags;
     153}
     154
     155bool
     156rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     157                                  rtems_rtl_obj_sect*  sect)
     158{
     159  (void) obj;
     160  (void) sect;
     161  return false;
     162}
     163
     164bool
     165rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     166                                  rtems_rtl_obj_sect*  sect)
     167{
     168  (void) obj;
     169  (void) sect;
     170  return false;
     171}
     172
    141173bool
    142174rtems_rtl_elf_rel_resolve_sym (Elf_Word type)
  • cpukit/libdl/rtl-mdreloc-v850.c

    r194eb403 r6c9f017  
    2121}
    2222
     23uint32_t
     24rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
     25                                  int                  section,
     26                                  const char*          name,
     27                                  const Elf_Shdr*      shdr,
     28                                  const uint32_t       flags)
     29{
     30  (void) obj;
     31  (void) section;
     32  (void) name;
     33  (void) shdr;
     34  return flags;
     35}
     36
     37bool
     38rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
     39                                  rtems_rtl_obj_sect*  sect)
     40{
     41  (void) obj;
     42  (void) sect;
     43  return false;
     44}
     45
     46bool
     47rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
     48                                  rtems_rtl_obj_sect*  sect)
     49{
     50  (void) obj;
     51  (void) sect;
     52  return false;
     53}
     54
    2355bool
    2456rtems_rtl_elf_rel_resolve_sym (Elf_Word type)
  • cpukit/libdl/rtl-obj.c

    r194eb403 r6c9f017  
    301301rtems_rtl_obj_sect_summer (rtems_chain_node* node, void* data)
    302302{
    303   rtems_rtl_obj_sect*             sect = (rtems_rtl_obj_sect*) node;
    304   rtems_rtl_obj_sect_summer_data* summer = data;
    305   if ((sect->flags & summer->mask) == summer->mask)
    306     summer->size =
    307       rtems_rtl_obj_align (summer->size, sect->alignment) + sect->size;
     303  rtems_rtl_obj_sect* sect = (rtems_rtl_obj_sect*) node;
     304  if ((sect->flags & RTEMS_RTL_OBJ_SECT_ARCH_ALLOC) == 0)
     305  {
     306    rtems_rtl_obj_sect_summer_data* summer = data;
     307    if ((sect->flags & summer->mask) == summer->mask)
     308      summer->size =
     309        rtems_rtl_obj_align (summer->size, sect->alignment) + sect->size;
     310  }
    308311  return true;
    309312}
     
    822825                          RTEMS_RTL_OBJ_SECT_REL |
    823826                          RTEMS_RTL_OBJ_SECT_RELA);
    824   return rtems_rtl_obj_section_handler (flags, obj, fd, handler, data);
     827  bool r = rtems_rtl_obj_section_handler (flags, obj, fd, handler, data);
     828  rtems_rtl_obj_update_flags (RTEMS_RTL_OBJ_RELOC_TAG, 0);
     829  return r;
    825830}
    826831
     
    994999}
    9951000
    996 static size_t
     1001static bool
    9971002rtems_rtl_obj_sections_loader (uint32_t                   mask,
    9981003                               rtems_rtl_obj*             obj,
     
    10051010  rtems_chain_node*    node = rtems_chain_first (sections);
    10061011  size_t               base_offset = 0;
    1007   bool                 first = true;
    10081012  int                  order = 0;
    10091013
     1014  if (rtems_rtl_trace (RTEMS_RTL_TRACE_LOAD_SECT))
     1015    printf ("rtl: loading section: mask:%08" PRIx32 " base:%p\n", mask, base);
     1016
    10101017  while (!rtems_chain_is_tail (sections, node))
    10111018  {
    10121019    rtems_rtl_obj_sect* sect = (rtems_rtl_obj_sect*) node;
    10131020
    1014     if ((sect->size != 0) && ((sect->flags & mask) != 0))
     1021    if ((sect->size != 0) && ((sect->flags & mask) == mask))
    10151022    {
    10161023      if (sect->load_order == order)
    10171024      {
    1018         if (!first)
     1025        if ((sect->flags & RTEMS_RTL_OBJ_SECT_ARCH_ALLOC) == 0)
     1026        {
    10191027          base_offset = rtems_rtl_obj_align (base_offset, sect->alignment);
    1020 
    1021         first = false;
    1022 
    1023         sect->base = base + base_offset;
     1028          sect->base = base + base_offset;
     1029        }
    10241030
    10251031        if (rtems_rtl_trace (RTEMS_RTL_TRACE_LOAD_SECT))
    1026           printf ("rtl: loading:%2d: %s -> %8p (s:%zi f:%04" PRIx32
     1032          printf ("rtl: loading:%2d: %s -> %p (s:%zi f:%04" PRIx32
    10271033                  " a:%" PRIu32 " l:%02d)\n",
    10281034                  order, sect->name, sect->base, sect->size,
     
    10391045        else if ((sect->flags & RTEMS_RTL_OBJ_SECT_ZERO) == RTEMS_RTL_OBJ_SECT_ZERO)
    10401046        {
    1041           memset (base + base_offset, 0, sect->size);
     1047          memset (sect->base, 0, sect->size);
    10421048        }
    10431049        else
     
    10661072
    10671073bool
    1068 rtems_rtl_obj_load_sections (rtems_rtl_obj*             obj,
    1069                              int                        fd,
    1070                              rtems_rtl_obj_sect_handler handler,
    1071                              void*                      data)
     1074rtems_rtl_obj_alloc_sections (rtems_rtl_obj*             obj,
     1075                              int                        fd,
     1076                              rtems_rtl_obj_sect_handler handler,
     1077                              void*                      data)
    10721078{
    10731079  size_t text_size;
     
    10911097  obj->eh_size    = eh_size;
    10921098  obj->bss_size   = bss_size;
     1099
     1100  /*
     1101   * Perform any specific allocations for sections.
     1102   */
     1103  if (handler != NULL)
     1104  {
     1105    if (!rtems_rtl_obj_section_handler (RTEMS_RTL_OBJ_SECT_TYPES,
     1106                                        obj,
     1107                                        fd,
     1108                                        handler,
     1109                                        data))
     1110    {
     1111      obj->exec_size = 0;
     1112      return false;
     1113    }
     1114  }
    10931115
    10941116  /*
     
    11301152  rtems_rtl_obj_sections_link_order (RTEMS_RTL_OBJ_SECT_EH,    obj);
    11311153  rtems_rtl_obj_sections_link_order (RTEMS_RTL_OBJ_SECT_DATA,  obj);
    1132 
     1154  rtems_rtl_obj_sections_link_order (RTEMS_RTL_OBJ_SECT_BSS,   obj);
     1155
     1156  return true;
     1157}
     1158
     1159bool
     1160rtems_rtl_obj_load_sections (rtems_rtl_obj*             obj,
     1161                             int                        fd,
     1162                             rtems_rtl_obj_sect_handler handler,
     1163                             void*                      data)
     1164{
    11331165  /*
    1134    * Load all text then data then bss sections in seperate operations so each
    1135    * type of section is grouped together.
     1166   * Load all text, data and bsssections in seperate operations so each type of
     1167   * section is grouped together. Finish by loading any architecure specific
     1168   * sections.
    11361169   */
    11371170  if (!rtems_rtl_obj_sections_loader (RTEMS_RTL_OBJ_SECT_TEXT,
  • cpukit/libdl/rtl-shell.c

    r194eb403 r6c9f017  
    176176  rtems_rtl_dep_data* dd = (rtems_rtl_dep_data*) data;
    177177  if (!dd->first)
    178     printf ("\n%-*c: ", dd->indent, ' ');
     178    printf ("\n%-*c: ", (int) dd->indent, ' ');
    179179  else
    180180    dd->first = false;
  • cpukit/libdl/rtl-unresolved.c

    r194eb403 r6c9f017  
    701701  case rtems_rtl_unresolved_symbol:
    702702    ++dd->names;
    703     printf (" %3zu: 1:  name: %3d refs:%4d: flags:%04x %s (%d)\n",
     703    printf (" %3zu: 1:  name: %3zu refs:%4d: flags:%04x %s (%d)\n",
    704704            dd->rec, dd->names,
    705705            rec->rec.name.refs,
  • testsuites/libtests/Makefile.am

    r194eb403 r6c9f017  
    391391lib_screens += dl03/dl03.scn
    392392lib_docs += dl03/dl03.doc
    393 dl03_SOURCES = dl03/init.c dl03/dl-cache.c
    394 dl03_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl03) $(support_includes)
     393dl03_SOURCES = dl03/init.c dl03/dl-cache.c dl03/dl-bit-alloc.c
     394dl03_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl03) $(support_includes) \
     395        -I$(top_srcdir)/../../cpukit/libdl
    395396endif
    396397endif
     
    534535        $(AM_V_CC)$(COMPILE) -c -o $@ $<
    535536dl07-o5.o: dl07/dl-o5.c Makefile
    536         $(AM_V_CC)$(COMPILE) -c -o $@ $<
     537        $(AM_V_CC) $(COMPILE) -c -o $@ $<
    537538dl07.tar: dl07-o1.o dl07-o2.o dl07-o3.o dl07-o4.o dl07-o5.o
    538539        @rm -f $@
  • testsuites/libtests/dl01/dl-load.c

    r194eb403 r6c9f017  
    2727                      RTEMS_RTL_TRACE_UNRESOLVED | \
    2828                      RTEMS_RTL_TRACE_ARCHIVES | \
     29                      RTEMS_RTL_TRACE_GLOBAL_SYM | \
    2930                      RTEMS_RTL_TRACE_DEPENDENCY)
    3031 #define DL_DEBUG_TRACE DEBUG_TRACE /* RTEMS_RTL_TRACE_ALL */
  • testsuites/libtests/dl02/dl-load.c

    r194eb403 r6c9f017  
    1616#include <rtems/rtl/rtl-trace.h>
    1717
    18 #define DL02_DEBUG_TRACE 0 /* RTEMS_RTL_TRACE_ALL */
    19 #define DL02_RTL_CMDS    0
     18#define TEST_TRACE 0
     19#if TEST_TRACE
     20 #define DL_DEBUG_TRACE (RTEMS_RTL_TRACE_ALL & ~RTEMS_RTL_TRACE_ALLOCATOR)
     21 #define DL_RTL_CMDS    1
     22#else
     23 #define DL_DEBUG_TRACE 0
     24 #define DL_RTL_CMDS    0
     25#endif
    2026
    2127typedef int (*call_t)(int argc, const char* argv[]);
     
    5662  int    ret;
    5763
    58 #if DL02_DEBUG_TRACE
    59   rtems_rtl_trace_set_mask (DL02_DEBUG_TRACE);
     64#if DL_DEBUG_TRACE
     65  rtems_rtl_trace_set_mask (DL_DEBUG_TRACE);
    6066#endif
    6167
     
    6773    return 1;
    6874
    69 #if DL02_RTL_CMDS
     75#if DL_RTL_CMDS
    7076  {
    7177    char* list[] = { "rtl", "list", NULL };
  • testsuites/libtests/dl02/dl-o1.c

    r194eb403 r6c9f017  
    3737int rtems_main (int argc, const char* argv[]);
    3838
     39#define PDOUBLE(_d) ((int) (_d)), (int) ((_d) * 100.0) % 100
     40
    3941int rtems_main (int argc, const char* argv[])
    4042{
    4143  func1_t f1;
     44  double  f2_ret;
    4245  int     arg;
    4346  int     ret;
     
    5760  }
    5861
    59   if (dl_o2_func2 (7.1, 33.0) != (7.1 * 33.0))
     62  f2_ret = dl_o2_func2 (7.1, 33.0);
     63  printf("rtems_main: dl_o2_func2 returned: %d.%02d\n",
     64         PDOUBLE(f2_ret));
     65  if (f2_ret != (7.1 * 33.0))
    6066  {
    61     printf("rtems_main: dl_o2_func1 returned bad value\n");
     67    printf("rtems_main: dl_o2_func2 returned a bad\n");
    6268    return 0;
    6369  }
  • testsuites/libtests/dl02/dl-o2.c

    r194eb403 r6c9f017  
    1111#include <rtems/test.h>
    1212
    13 #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__);
     13#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__)
    1414
    1515int dl_o2_func1 (int argc, char* argv[])
     
    2222}
    2323
     24#define PDOUBLE(_d) ((int) (_d)), (int) (((_d) + 0.005) * 100.0) % 100
     25
    2426double dl_o2_func2 (double d1, double d2)
    2527{
    26   return d1 * d2;
     28  double ret = d1 * d2;
     29  printf("dl_o2_func2: d1=%d.%02d d2=%d.%d ret=%d.%02d\n",
     30         PDOUBLE(d1), PDOUBLE(d2), PDOUBLE(ret));
     31  return ret;
    2732}
    2833
     
    3136  return callback ("string in dl_o2", count + 1);
    3237}
    33 
  • testsuites/libtests/dl03/init.c

    r194eb403 r6c9f017  
    1919
    2020#include "dl-cache.h"
     21#include "dl-bit-alloc.h"
    2122
    2223const char rtems_test_name[] = "libdl (RTL) 3";
     
    2930  int ret;
    3031  ret = dl_cache_test();
     32  if (ret)
     33    rtems_test_exit(ret);
     34  ret = dl_bit_alloc_test();
    3135  if (ret)
    3236    rtems_test_exit(ret);
  • testsuites/libtests/dl05/dl-load.c

    r194eb403 r6c9f017  
    2121#include "dl-load.h"
    2222
     23#define TEST_TRACE 0
     24#if TEST_TRACE
     25 #define DEBUG_TRACE (RTEMS_RTL_TRACE_DETAIL | \
     26                      RTEMS_RTL_TRACE_WARNING | \
     27                      RTEMS_RTL_TRACE_LOAD | \
     28                      RTEMS_RTL_TRACE_UNLOAD | \
     29                      RTEMS_RTL_TRACE_SYMBOL | \
     30                      RTEMS_RTL_TRACE_RELOC | \
     31                      RTEMS_RTL_TRACE_ALLOCATOR | \
     32                      RTEMS_RTL_TRACE_UNRESOLVED | \
     33                      RTEMS_RTL_TRACE_ARCHIVES | \
     34                      RTEMS_RTL_TRACE_GLOBAL_SYM | \
     35                      RTEMS_RTL_TRACE_DEPENDENCY)
     36 #define DL_DEBUG_TRACE DEBUG_TRACE /* RTEMS_RTL_TRACE_ALL */
     37#else
     38 #define DL_DEBUG_TRACE 0
     39#endif
     40
    2341int dl_load_test(void)
    2442{
     
    3553#endif
    3654
    37   rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL);
     55#if DL_DEBUG_TRACE
     56  rtems_rtl_trace_set_mask (DL_DEBUG_TRACE);
     57#endif
    3858
    3959  handle = dlopen("/dl05-o5.o", RTLD_GLOBAL | RTLD_NOW);
  • testsuites/libtests/dl07/dl-load.c

    r194eb403 r6c9f017  
    88 */
    99
    10 #define DL07_DEBUG_TRACE 0 /* RTEMS_RTL_TRACE_ALL */
    11 #define DL07_RTL_CMDS    0
     10#define TEST_TRACE 0
     11#if TEST_TRACE
     12 #define DEBUG_TRACE (RTEMS_RTL_TRACE_DETAIL | \
     13                      RTEMS_RTL_TRACE_WARNING | \
     14                      RTEMS_RTL_TRACE_LOAD | \
     15                      RTEMS_RTL_TRACE_UNLOAD | \
     16                      RTEMS_RTL_TRACE_SYMBOL | \
     17                      RTEMS_RTL_TRACE_RELOC | \
     18                      RTEMS_RTL_TRACE_ALLOCATOR | \
     19                      RTEMS_RTL_TRACE_UNRESOLVED | \
     20                      RTEMS_RTL_TRACE_ARCHIVES | \
     21                      RTEMS_RTL_TRACE_GLOBAL_SYM | \
     22                      RTEMS_RTL_TRACE_DEPENDENCY)
     23 #define DL_DEBUG_TRACE DEBUG_TRACE /* RTEMS_RTL_TRACE_ALL */
     24 #define DL_RTL_CMDS    1
     25#else
     26 #define DL_DEBUG_TRACE 0
     27 #define DL_RTL_CMDS    0
     28#endif
    1229
    1330#include <dlfcn.h>
     
    2441static void dl_load_dump (void)
    2542{
    26 #if DL07_RTL_CMDS
     43#if DL_RTL_CMDS
    2744  char* list[] = { "rtl", "list", NULL };
    2845  char* sym[] = { "rtl", "sym", NULL };
     
    108125  printf ("Test source (link in strstr): %s\n", dl_localise_file (__FILE__));
    109126
    110 #if DL07_DEBUG_TRACE
    111   rtems_rtl_trace_set_mask (DL07_DEBUG_TRACE);
     127#if DL_DEBUG_TRACE
     128  rtems_rtl_trace_set_mask (DL_DEBUG_TRACE);
    112129#endif
    113130
  • testsuites/libtests/dl07/dl-o1.c

    r194eb403 r6c9f017  
    4444{
    4545  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    46   printf (DL_NAME ":         dl01_bss1: %4u: %p: %d\n",   PAINT_VAR (dl01_bss1));
    47   printf (DL_NAME ":         dl01_bss2: %4u: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
    48   printf (DL_NAME ":         dl01_bss3: %4u: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
    49   printf (DL_NAME ":        dl01_data1: %4u: %p: %d\n",   PAINT_VAR (dl01_data1));
     46  printf (DL_NAME ":         dl01_bss1: %4zu: %p: %d\n",   PAINT_VAR (dl01_bss1));
     47  printf (DL_NAME ":         dl01_bss2: %4zu: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
     48  printf (DL_NAME ":         dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
     49  printf (DL_NAME ":        dl01_data1: %4zu: %p: %d\n",   PAINT_VAR (dl01_data1));
    5050  /* no  %f in the rtems test printer */
    51   printf (DL_NAME ":        dl01_data2: %4u: %p: %f\n",   PAINT_VAR (dl01_data2));
    52   printf (DL_NAME ":       dl01_const1: %4u: %p: %d\n",   PAINT_VAR (dl01_const1));
    53   printf (DL_NAME ":       dl01_const2: %4u: %p: %f\n",   PAINT_VAR (dl01_const2));
    54   printf (DL_NAME ":        dl01_func1: %4u: %p\n",       sizeof(dl01_func1), &dl01_func1);
     51  printf (DL_NAME ":        dl01_data2: %4zu: %p: %f\n",   PAINT_VAR (dl01_data2));
     52  printf (DL_NAME ":       dl01_const1: %4zu: %p: %d\n",   PAINT_VAR (dl01_const1));
     53  printf (DL_NAME ":       dl01_const2: %4zu: %p: %f\n",   PAINT_VAR (dl01_const2));
     54  printf (DL_NAME ":        dl01_func1: %4zu: %p\n",       sizeof(dl01_func1), &dl01_func1);
    5555  return 0;
    5656}
  • testsuites/libtests/dl07/dl-o2.c

    r194eb403 r6c9f017  
    3333{
    3434  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    35   printf (DL_NAME ":         dl01_bss1: %4u: %p: %d\n",   PAINT_VAR (dl01_bss1));
    36   printf (DL_NAME ":         dl01_bss2: %4u: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
    37   printf (DL_NAME ":         dl01_bss3: %4u: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
    38   printf (DL_NAME ":        dl01_data1: %4u: %p: %d\n",   PAINT_VAR (dl01_data1));
     35  printf (DL_NAME ":         dl01_bss1: %4zu: %p: %d\n",   PAINT_VAR (dl01_bss1));
     36  printf (DL_NAME ":         dl01_bss2: %4zu: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
     37  printf (DL_NAME ":         dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
     38  printf (DL_NAME ":        dl01_data1: %4zu: %p: %d\n",   PAINT_VAR (dl01_data1));
    3939  /* no  %f in the rtems test printer */
    40   printf (DL_NAME ":        dl01_data2: %4u: %p: %f\n",   PAINT_VAR (dl01_data2));
    41   printf (DL_NAME ":       dl01_const1: %4u: %p: %d\n",   PAINT_VAR (dl01_const1));
    42   printf (DL_NAME ":       dl01_const2: %4u: %p: %f\n",   PAINT_VAR (dl01_const2));
    43   printf (DL_NAME ":        dl01_func1: %4u: %p\n",       sizeof(dl01_func1), &dl01_func1);
    44   printf (DL_NAME ":         dl02_bss1: %4u: %p: %d\n",   PAINT_VAR (dl02_bss1));
    45   printf (DL_NAME ":         dl02_bss2: %4u: %p: %f\n",   PAINT_VAR (dl02_bss2[0]));
    46   printf (DL_NAME ":         dl02_bss3: %4u: %p: %02x\n", PAINT_VAR (dl02_bss3[0]));
    47   printf (DL_NAME ":        dl02_data1: %4u: %p: %d\n",   PAINT_VAR (dl02_data1));
     40  printf (DL_NAME ":        dl01_data2: %4zu: %p: %f\n",   PAINT_VAR (dl01_data2));
     41  printf (DL_NAME ":       dl01_const1: %4zu: %p: %d\n",   PAINT_VAR (dl01_const1));
     42  printf (DL_NAME ":       dl01_const2: %4zu: %p: %f\n",   PAINT_VAR (dl01_const2));
     43  printf (DL_NAME ":        dl01_func1: %4zu: %p\n",       sizeof(dl01_func1), &dl01_func1);
     44  printf (DL_NAME ":         dl02_bss1: %4zu: %p: %d\n",   PAINT_VAR (dl02_bss1));
     45  printf (DL_NAME ":         dl02_bss2: %4zu: %p: %f\n",   PAINT_VAR (dl02_bss2[0]));
     46  printf (DL_NAME ":         dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0]));
     47  printf (DL_NAME ":        dl02_data1: %4zu: %p: %d\n",   PAINT_VAR (dl02_data1));
    4848  /* no %f in the rtems test printer */
    49   printf (DL_NAME ":        dl02_data2: %4u: %p: %f\n",   PAINT_VAR (dl02_data2));
     49  printf (DL_NAME ":        dl02_data2: %4zu: %p: %f\n",   PAINT_VAR (dl02_data2));
    5050  return 0;
    5151}
  • testsuites/libtests/dl07/dl-o3.c

    r194eb403 r6c9f017  
    3030{
    3131  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    32   printf (DL_NAME ":         dl01_bss1: %4u: %p: %d\n",          PAINT_VAR (dl01_bss1));
    33   printf (DL_NAME ":         dl01_bss2: %4u: %p: %f\n",          PAINT_VAR (dl01_bss2[0]));
    34   printf (DL_NAME ":         dl01_bss3: %4u: %p: %02x\n",        PAINT_VAR (dl01_bss3[0]));
    35   printf (DL_NAME ":        dl01_data1: %4u: %p: %d\n",          PAINT_VAR (dl01_data1));
     32  printf (DL_NAME ":         dl01_bss1: %4zu: %p: %d\n",          PAINT_VAR (dl01_bss1));
     33  printf (DL_NAME ":         dl01_bss2: %4zu: %p: %f\n",          PAINT_VAR (dl01_bss2[0]));
     34  printf (DL_NAME ":         dl01_bss3: %4zu: %p: %02x\n",        PAINT_VAR (dl01_bss3[0]));
     35  printf (DL_NAME ":        dl01_data1: %4zu: %p: %d\n",          PAINT_VAR (dl01_data1));
    3636  /* no  %f in the rtems test printer */
    37   printf (DL_NAME ":        dl01_data2: %4u: %p: %f\n",          PAINT_VAR (dl01_data2));
    38   printf (DL_NAME ":       dl01_const1: %4u: %p: %d\n",          PAINT_VAR (dl01_const1));
    39   printf (DL_NAME ":       dl01_const2: %4u: %p: %f\n",          PAINT_VAR (dl01_const2));
    40   printf (DL_NAME ":        dl01_func1: %4u: %p\n",              sizeof(dl01_func1), &dl01_func1);
    41   printf (DL_NAME ":         dl02_bss1: %4u: %p: %d\n",          PAINT_VAR (dl02_bss1));
    42   printf (DL_NAME ":         dl02_bss2: %4u: %p: %f\n",          PAINT_VAR (dl02_bss2[0]));
    43   printf (DL_NAME ":         dl02_bss3: %4u: %p: %02x\n",        PAINT_VAR (dl02_bss3[0]));
    44   printf (DL_NAME ":        dl02_data1: %4u: %p: %d\n",          PAINT_VAR (dl02_data1));
     37  printf (DL_NAME ":        dl01_data2: %4zu: %p: %f\n",          PAINT_VAR (dl01_data2));
     38  printf (DL_NAME ":       dl01_const1: %4zu: %p: %d\n",          PAINT_VAR (dl01_const1));
     39  printf (DL_NAME ":       dl01_const2: %4zu: %p: %f\n",          PAINT_VAR (dl01_const2));
     40  printf (DL_NAME ":        dl01_func1: %4zu: %p\n",              sizeof(dl01_func1), &dl01_func1);
     41  printf (DL_NAME ":         dl02_bss1: %4zu: %p: %d\n",          PAINT_VAR (dl02_bss1));
     42  printf (DL_NAME ":         dl02_bss2: %4zu: %p: %f\n",          PAINT_VAR (dl02_bss2[0]));
     43  printf (DL_NAME ":         dl02_bss3: %4zu: %p: %02x\n",        PAINT_VAR (dl02_bss3[0]));
     44  printf (DL_NAME ":        dl02_data1: %4zu: %p: %d\n",          PAINT_VAR (dl02_data1));
    4545  /* no %f in the rtems test printer */
    46   printf (DL_NAME ":        dl02_data2: %4u: %p: %f\n",          PAINT_VAR (dl02_data2));
    47   printf (DL_NAME ":   dl04_unresolv_1: %4u: %p: %d\n",          PAINT_VAR (dl04_unresolv_1));
    48   printf (DL_NAME ":   dl04_unresolv_2: %4u: %p: %f\n",          PAINT_VAR (dl04_unresolv_2));
    49   printf (DL_NAME ":   dl04_unresolv_3: %4u: %p: %02x\n",        PAINT_VAR (dl04_unresolv_3));
    50   printf (DL_NAME ":   dl04_unresolv_4: %4u: %p: %p\n",          PAINT_VAR (dl04_unresolv_4));
    51   printf (DL_NAME ":   dl04_unresolv_5: %4u: %p: %d\n",          PAINT_VAR (dl04_unresolv_5));
    52   printf (DL_NAME ":   dl04_unresolv_6: %4u: %p: %s\n",          PAINT_VAR (dl04_unresolv_6));
    53   printf (DL_NAME ":   dl05_unresolv_1: %4u: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
    54   printf (DL_NAME ":   dl05_unresolv_2: %4u: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
    55   printf (DL_NAME ":   dl05_unresolv_3: %4u: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
    56   printf (DL_NAME ":   dl05_unresolv_4: %4u: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
    57   printf (DL_NAME ":   dl05_unresolv_5: %4u: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
     46  printf (DL_NAME ":        dl02_data2: %4zu: %p: %f\n",          PAINT_VAR (dl02_data2));
     47  printf (DL_NAME ":   dl04_unresolv_1: %4zu: %p: %d\n",          PAINT_VAR (dl04_unresolv_1));
     48  printf (DL_NAME ":   dl04_unresolv_2: %4zu: %p: %f\n",          PAINT_VAR (dl04_unresolv_2));
     49  printf (DL_NAME ":   dl04_unresolv_3: %4zu: %p: %02x\n",        PAINT_VAR (dl04_unresolv_3));
     50  printf (DL_NAME ":   dl04_unresolv_4: %4zu: %p: %p\n",          PAINT_VAR (dl04_unresolv_4));
     51  printf (DL_NAME ":   dl04_unresolv_5: %4zu: %p: %d\n",          PAINT_VAR (dl04_unresolv_5));
     52  printf (DL_NAME ":   dl04_unresolv_6: %4zu: %p: %s\n",          PAINT_VAR (dl04_unresolv_6));
     53  printf (DL_NAME ":   dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
     54  printf (DL_NAME ":   dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
     55  printf (DL_NAME ":   dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
     56  printf (DL_NAME ":   dl05_unresolv_4: %4zu: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
     57  printf (DL_NAME ":   dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
    5858  return 0;
    5959}
  • testsuites/libtests/dl07/dl-o4.c

    r194eb403 r6c9f017  
    3535{
    3636  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    37   printf (DL_NAME ":         dl01_bss1: %4u: %p: %d\n",   PAINT_VAR (dl01_bss1));
    38   printf (DL_NAME ":         dl01_bss2: %4u: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
    39   printf (DL_NAME ":         dl01_bss3: %4u: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
    40   printf (DL_NAME ":        dl01_data1: %4u: %p: %d\n",   PAINT_VAR (dl01_data1));
     37  printf (DL_NAME ":         dl01_bss1: %4zu: %p: %d\n",   PAINT_VAR (dl01_bss1));
     38  printf (DL_NAME ":         dl01_bss2: %4zu: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
     39  printf (DL_NAME ":         dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
     40  printf (DL_NAME ":        dl01_data1: %4zu: %p: %d\n",   PAINT_VAR (dl01_data1));
    4141  /* no  %f in the rtems test printer */
    42   printf (DL_NAME ":        dl01_data2: %4u: %p: %f\n",   PAINT_VAR (dl01_data2));
    43   printf (DL_NAME ":       dl01_const1: %4u: %p: %d\n",   PAINT_VAR (dl01_const1));
    44   printf (DL_NAME ":       dl01_const2: %4u: %p: %f\n",   PAINT_VAR (dl01_const2));
    45   printf (DL_NAME ":        dl01_func1: %4u: %p\n",       sizeof(dl01_func1), &dl01_func1);
    46   printf (DL_NAME ":   dl04_unresolv_1: %4u: %p: %d\n",   PAINT_VAR (dl04_unresolv_1));
    47   printf (DL_NAME ":   dl04_unresolv_2: %4u: %p: %f\n",   PAINT_VAR (dl04_unresolv_2));
    48   printf (DL_NAME ":   dl04_unresolv_3: %4u: %p: %02x\n", PAINT_VAR (dl04_unresolv_3));
    49   printf (DL_NAME ":   dl04_unresolv_4: %4u: %p: %p\n",   PAINT_VAR (dl04_unresolv_4));
    50   printf (DL_NAME ":   dl04_unresolv_5: %4u: %p: %d\n",   PAINT_VAR (dl04_unresolv_5));
    51   printf (DL_NAME ":   dl04_unresolv_6: %4u: %p: %s\n",   PAINT_VAR (dl04_unresolv_6));
     42  printf (DL_NAME ":        dl01_data2: %4zu: %p: %f\n",   PAINT_VAR (dl01_data2));
     43  printf (DL_NAME ":       dl01_const1: %4zu: %p: %d\n",   PAINT_VAR (dl01_const1));
     44  printf (DL_NAME ":       dl01_const2: %4zu: %p: %f\n",   PAINT_VAR (dl01_const2));
     45  printf (DL_NAME ":        dl01_func1: %4zu: %p\n",       sizeof(dl01_func1), &dl01_func1);
     46  printf (DL_NAME ":   dl04_unresolv_1: %4zu: %p: %d\n",   PAINT_VAR (dl04_unresolv_1));
     47  printf (DL_NAME ":   dl04_unresolv_2: %4zu: %p: %f\n",   PAINT_VAR (dl04_unresolv_2));
     48  printf (DL_NAME ":   dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3));
     49  printf (DL_NAME ":   dl04_unresolv_4: %4zu: %p: %p\n",   PAINT_VAR (dl04_unresolv_4));
     50  printf (DL_NAME ":   dl04_unresolv_5: %4zu: %p: %d\n",   PAINT_VAR (dl04_unresolv_5));
     51  printf (DL_NAME ":   dl04_unresolv_6: %4zu: %p: %s\n",   PAINT_VAR (dl04_unresolv_6));
    5252  return 0;
    5353}
  • testsuites/libtests/dl07/dl-o5.c

    r194eb403 r6c9f017  
    3535{
    3636  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    37   printf (DL_NAME ":         dl01_bss1: %4u: %p: %d\n",          PAINT_VAR (dl01_bss1));
    38   printf (DL_NAME ":         dl01_bss2: %4u: %p: %f\n",          PAINT_VAR (dl01_bss2[0]));
    39   printf (DL_NAME ":         dl01_bss3: %4u: %p: %02x\n",        PAINT_VAR (dl01_bss3[0]));
    40   printf (DL_NAME ":        dl01_data1: %4u: %p: %d\n",          PAINT_VAR (dl01_data1));
     37  printf (DL_NAME ":         dl01_bss1: %4zu: %p: %d\n",          PAINT_VAR (dl01_bss1));
     38  printf (DL_NAME ":         dl01_bss2: %4zu: %p: %f\n",          PAINT_VAR (dl01_bss2[0]));
     39  printf (DL_NAME ":         dl01_bss3: %4zu: %p: %02x\n",        PAINT_VAR (dl01_bss3[0]));
     40  printf (DL_NAME ":        dl01_data1: %4zu: %p: %d\n",          PAINT_VAR (dl01_data1));
    4141  /* no  %f in the rtems test printer */
    42   printf (DL_NAME ":        dl01_data2: %4u: %p: %f\n",          PAINT_VAR (dl01_data2));
    43   printf (DL_NAME ":       dl01_const1: %4u: %p: %d\n",          PAINT_VAR (dl01_const1));
    44   printf (DL_NAME ":       dl01_const2: %4u: %p: %f\n",          PAINT_VAR (dl01_const2));
    45   printf (DL_NAME ":        dl01_func1: %4u: %p\n",              sizeof(dl01_func1), &dl01_func1);
    46   printf (DL_NAME ":   dl05_unresolv_1: %4u: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
    47   printf (DL_NAME ":   dl05_unresolv_2: %4u: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
    48   printf (DL_NAME ":   dl05_unresolv_3: %4u: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
    49   printf (DL_NAME ":   dl05_unresolv_4: %4u: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
    50   printf (DL_NAME ":   dl05_unresolv_5: %4u: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
     42  printf (DL_NAME ":        dl01_data2: %4zu: %p: %f\n",          PAINT_VAR (dl01_data2));
     43  printf (DL_NAME ":       dl01_const1: %4zu: %p: %d\n",          PAINT_VAR (dl01_const1));
     44  printf (DL_NAME ":       dl01_const2: %4zu: %p: %f\n",          PAINT_VAR (dl01_const2));
     45  printf (DL_NAME ":        dl01_func1: %4zu: %p\n",              sizeof(dl01_func1), &dl01_func1);
     46  printf (DL_NAME ":   dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
     47  printf (DL_NAME ":   dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
     48  printf (DL_NAME ":   dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
     49  printf (DL_NAME ":   dl05_unresolv_4: %4zu: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
     50  printf (DL_NAME ":   dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
    5151  return 0;
    5252}
  • testsuites/libtests/dl07/init.c

    r194eb403 r6c9f017  
    5757  }
    5858
    59   for (i = 0; i < 100; ++i)
     59  for (i = 0; i < 1; ++i)
    6060  {
    6161    printf ("--------------------------------------------------\n");
  • testsuites/libtests/dl08/dl-o1.c

    r194eb403 r6c9f017  
    4646{
    4747  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    48   printf (DL_NAME ":         dl01_bss1: %4u: %p: %d\n",   PAINT_VAR (dl01_bss1));
    49   printf (DL_NAME ":         dl01_bss2: %4u: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
    50   printf (DL_NAME ":         dl01_bss3: %4u: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
    51   printf (DL_NAME ":        dl01_data1: %4u: %p: %d\n",   PAINT_VAR (dl01_data1));
     48  printf (DL_NAME ":         dl01_bss1: %4zu: %p: %d\n",   PAINT_VAR (dl01_bss1));
     49  printf (DL_NAME ":         dl01_bss2: %4zu: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
     50  printf (DL_NAME ":         dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
     51  printf (DL_NAME ":        dl01_data1: %4zu: %p: %d\n",   PAINT_VAR (dl01_data1));
    5252  /* no  %f in the rtems test printer */
    53   printf (DL_NAME ":        dl01_data2: %4u: %p: %f\n",   PAINT_VAR (dl01_data2));
    54   printf (DL_NAME ":       dl01_const1: %4u: %p: %d\n",   PAINT_VAR (dl01_const1));
    55   printf (DL_NAME ":       dl01_const2: %4u: %p: %f\n",   PAINT_VAR (dl01_const2));
    56   printf (DL_NAME ":        dl01_func1: %4u: %p\n",       sizeof(dl01_func1), &dl01_func1);
     53  printf (DL_NAME ":        dl01_data2: %4zu: %p: %f\n",   PAINT_VAR (dl01_data2));
     54  printf (DL_NAME ":       dl01_const1: %4zu: %p: %d\n",   PAINT_VAR (dl01_const1));
     55  printf (DL_NAME ":       dl01_const2: %4zu: %p: %f\n",   PAINT_VAR (dl01_const2));
     56  printf (DL_NAME ":        dl01_func1: %4zu: %p\n",       sizeof(dl01_func1), &dl01_func1);
    5757
    5858  rtems_main_o2 ();
  • testsuites/libtests/dl08/dl-o2.c

    r194eb403 r6c9f017  
    2727{
    2828  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    29   printf (DL_NAME ":         dl02_bss1: %4u: %p: %d\n",   PAINT_VAR (dl02_bss1));
    30   printf (DL_NAME ":         dl02_bss2: %4u: %p: %f\n",   PAINT_VAR (dl02_bss2[0]));
    31   printf (DL_NAME ":         dl02_bss3: %4u: %p: %02x\n", PAINT_VAR (dl02_bss3[0]));
    32   printf (DL_NAME ":        dl02_data1: %4u: %p: %d\n",   PAINT_VAR (dl02_data1));
     29  printf (DL_NAME ":         dl02_bss1: %4zu: %p: %d\n",   PAINT_VAR (dl02_bss1));
     30  printf (DL_NAME ":         dl02_bss2: %4zu: %p: %f\n",   PAINT_VAR (dl02_bss2[0]));
     31  printf (DL_NAME ":         dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0]));
     32  printf (DL_NAME ":        dl02_data1: %4zu: %p: %d\n",   PAINT_VAR (dl02_data1));
    3333  /* no %f in the rtems test printer */
    34   printf (DL_NAME ":        dl02_data2: %4u: %p: %f\n",   PAINT_VAR (dl02_data2));
     34  printf (DL_NAME ":        dl02_data2: %4zu: %p: %f\n",   PAINT_VAR (dl02_data2));
    3535
    3636  rtems_main_o3 ();
  • testsuites/libtests/dl08/dl-o3.c

    r194eb403 r6c9f017  
    2323{
    2424  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    25   printf (DL_NAME ":   dl04_unresolv_1: %4u: %p: %d\n",          PAINT_VAR (dl04_unresolv_1));
    26   printf (DL_NAME ":   dl04_unresolv_2: %4u: %p: %f\n",          PAINT_VAR (dl04_unresolv_2));
    27   printf (DL_NAME ":   dl04_unresolv_3: %4u: %p: %02x\n",        PAINT_VAR (dl04_unresolv_3));
    28   printf (DL_NAME ":   dl04_unresolv_4: %4u: %p: %p\n",          PAINT_VAR (dl04_unresolv_4));
    29   printf (DL_NAME ":   dl04_unresolv_5: %4u: %p: %d\n",          PAINT_VAR (dl04_unresolv_5));
    30   printf (DL_NAME ":   dl04_unresolv_6: %4u: %p: %s\n",          PAINT_VAR (dl04_unresolv_6));
    31   printf (DL_NAME ":   dl05_unresolv_1: %4u: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
    32   printf (DL_NAME ":   dl05_unresolv_2: %4u: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
    33   printf (DL_NAME ":   dl05_unresolv_3: %4u: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
    34   printf (DL_NAME ":   dl05_unresolv_4: %4u: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
    35   printf (DL_NAME ":   dl05_unresolv_5: %4u: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
     25  printf (DL_NAME ":   dl04_unresolv_1: %4zu: %p: %d\n",          PAINT_VAR (dl04_unresolv_1));
     26  printf (DL_NAME ":   dl04_unresolv_2: %4zu: %p: %f\n",          PAINT_VAR (dl04_unresolv_2));
     27  printf (DL_NAME ":   dl04_unresolv_3: %4zu: %p: %02x\n",        PAINT_VAR (dl04_unresolv_3));
     28  printf (DL_NAME ":   dl04_unresolv_4: %4zu: %p: %p\n",          PAINT_VAR (dl04_unresolv_4));
     29  printf (DL_NAME ":   dl04_unresolv_5: %4zu: %p: %d\n",          PAINT_VAR (dl04_unresolv_5));
     30  printf (DL_NAME ":   dl04_unresolv_6: %4zu: %p: %s\n",          PAINT_VAR (dl04_unresolv_6));
     31  printf (DL_NAME ":   dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
     32  printf (DL_NAME ":   dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
     33  printf (DL_NAME ":   dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
     34  printf (DL_NAME ":   dl05_unresolv_4: %4zu: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
     35  printf (DL_NAME ":   dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
    3636
    3737  rtems_main_o4 ();
  • testsuites/libtests/dl08/dl-o4.c

    r194eb403 r6c9f017  
    2828{
    2929  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    30   printf (DL_NAME ":   dl04_unresolv_1: %4u: %p: %d\n",   PAINT_VAR (dl04_unresolv_1));
    31   printf (DL_NAME ":   dl04_unresolv_2: %4u: %p: %f\n",   PAINT_VAR (dl04_unresolv_2));
    32   printf (DL_NAME ":   dl04_unresolv_3: %4u: %p: %02x\n", PAINT_VAR (dl04_unresolv_3));
    33   printf (DL_NAME ":   dl04_unresolv_4: %4u: %p: %p\n",   PAINT_VAR (dl04_unresolv_4));
    34   printf (DL_NAME ":   dl04_unresolv_5: %4u: %p: %d\n",   PAINT_VAR (dl04_unresolv_5));
    35   printf (DL_NAME ":   dl04_unresolv_6: %4u: %p: %s\n",   PAINT_VAR (dl04_unresolv_6));
     30  printf (DL_NAME ":   dl04_unresolv_1: %4zu: %p: %d\n",   PAINT_VAR (dl04_unresolv_1));
     31  printf (DL_NAME ":   dl04_unresolv_2: %4zu: %p: %f\n",   PAINT_VAR (dl04_unresolv_2));
     32  printf (DL_NAME ":   dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3));
     33  printf (DL_NAME ":   dl04_unresolv_4: %4zu: %p: %p\n",   PAINT_VAR (dl04_unresolv_4));
     34  printf (DL_NAME ":   dl04_unresolv_5: %4zu: %p: %d\n",   PAINT_VAR (dl04_unresolv_5));
     35  printf (DL_NAME ":   dl04_unresolv_6: %4zu: %p: %s\n",   PAINT_VAR (dl04_unresolv_6));
    3636
    3737  rtems_main_o5 ();
  • testsuites/libtests/dl08/dl-o5.c

    r194eb403 r6c9f017  
    2828{
    2929  printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    30   printf (DL_NAME ":   dl05_unresolv_1: %4u: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
    31   printf (DL_NAME ":   dl05_unresolv_2: %4u: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
    32   printf (DL_NAME ":   dl05_unresolv_3: %4u: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
    33   printf (DL_NAME ":   dl05_unresolv_4: %4u: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
    34   printf (DL_NAME ":   dl05_unresolv_5: %4u: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
     30  printf (DL_NAME ":   dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
     31  printf (DL_NAME ":   dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
     32  printf (DL_NAME ":   dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
     33  printf (DL_NAME ":   dl05_unresolv_4: %4zu: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
     34  printf (DL_NAME ":   dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
    3535
    3636  rtems_main_o6 ();
  • testsuites/libtests/dl08/dl-o6-123456789-123456789.c

    r194eb403 r6c9f017  
    3030{
    3131  printf (DL_NAME ": CONSTRUCTOR: %s\n", dl_localise_file (__FILE__));
    32   printf (DL_NAME ":   dl06_unresolv_1: %4u: %p: %" PRIu64 "\n", PAINT_VAR (dl06_unresolv_1));
    33   printf (DL_NAME ":   dl06_unresolv_2: %4u: %p: %" PRIu16 "\n", PAINT_VAR (dl06_unresolv_2));
    34   printf (DL_NAME ":   dl06_unresolv_3: %4u: %p: %" PRIu32 "\n", PAINT_VAR (dl06_unresolv_3));
    35   printf (DL_NAME ":   dl06_unresolv_4: %4u: %p: %" PRIu8  "\n", PAINT_VAR (dl06_unresolv_4));
    36   printf (DL_NAME ":   dl06_unresolv_5: %4u: %p: %" PRIi64 "\n", PAINT_VAR (dl06_unresolv_5));
     32  printf (DL_NAME ":   dl06_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl06_unresolv_1));
     33  printf (DL_NAME ":   dl06_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl06_unresolv_2));
     34  printf (DL_NAME ":   dl06_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl06_unresolv_3));
     35  printf (DL_NAME ":   dl06_unresolv_4: %4zu: %p: %" PRIu8  "\n", PAINT_VAR (dl06_unresolv_4));
     36  printf (DL_NAME ":   dl06_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl06_unresolv_5));
    3737}
    3838
  • testsuites/libtests/dl09/dl-load.c

    r194eb403 r6c9f017  
    1919                      RTEMS_RTL_TRACE_UNRESOLVED | \
    2020                      RTEMS_RTL_TRACE_ARCHIVES | \
    21                       RTEMS_RTL_TRACE_DEPENDENCY)
     21                      RTEMS_RTL_TRACE_DEPENDENCY | \
     22                      RTEMS_RTL_TRACE_LOAD_SECT | \
     23                      RTEMS_RTL_TRACE_BIT_ALLOC)
    2224 #define DL09_DEBUG_TRACE DEBUG_TRACE /* RTEMS_RTL_TRACE_ALL */
    2325 #define DL09_RTL_CMDS    1
  • testsuites/libtests/dl09/dl-o1.c

    r194eb403 r6c9f017  
    4545int rtems_main_o1 (void)
    4646{
    47   printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    48   printf (DL_NAME ":         dl01_bss1: %4u: %p: %d\n",   PAINT_VAR (dl01_bss1));
    49   printf (DL_NAME ":         dl01_bss2: %4u: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
    50   printf (DL_NAME ":         dl01_bss3: %4u: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
    51   printf (DL_NAME ":        dl01_data1: %4u: %p: %d\n",   PAINT_VAR (dl01_data1));
     47  printf (DL_NAME ": module: %s @ %p\n",
     48          dl_localise_file (__FILE__), rtems_main_o1);
     49  printf (DL_NAME ":         dl01_bss1: %4zu: %p: %d\n",   PAINT_VAR (dl01_bss1));
     50  printf (DL_NAME ":         dl01_bss2: %4zu: %p: %f\n",   PAINT_VAR (dl01_bss2[0]));
     51  printf (DL_NAME ":         dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0]));
     52  printf (DL_NAME ":        dl01_data1: %4zu: %p: %d\n",   PAINT_VAR (dl01_data1));
    5253  /* no  %f in the rtems test printer */
    53   printf (DL_NAME ":        dl01_data2: %4u: %p: %f\n",   PAINT_VAR (dl01_data2));
    54   printf (DL_NAME ":       dl01_const1: %4u: %p: %d\n",   PAINT_VAR (dl01_const1));
    55   printf (DL_NAME ":       dl01_const2: %4u: %p: %f\n",   PAINT_VAR (dl01_const2));
    56   printf (DL_NAME ":        dl01_func1: %4u: %p\n",       sizeof(dl01_func1), &dl01_func1);
     54  printf (DL_NAME ":        dl01_data2: %4zu: %p: %f\n",   PAINT_VAR (dl01_data2));
     55  printf (DL_NAME ":       dl01_const1: %4zu: %p: %d\n",   PAINT_VAR (dl01_const1));
     56  printf (DL_NAME ":       dl01_const2: %4zu: %p: %f\n",   PAINT_VAR (dl01_const2));
     57  printf (DL_NAME ":        dl01_func1: %4zu: %p\n",       sizeof(dl01_func1), &dl01_func1);
    5758
    5859  rtems_main_o2 ();
  • testsuites/libtests/dl09/dl-o2.c

    r194eb403 r6c9f017  
    1818float dl02_bss2[7];
    1919char  dl02_bss3[21];
    20 int   dl02_data1;
     20int   dl02_data1 = 0x12345678;
    2121float dl02_data2;
    2222
     
    2626int rtems_main_o2 (void)
    2727{
    28   printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    29   printf (DL_NAME ":         dl02_bss1: %4u: %p: %d\n",   PAINT_VAR (dl02_bss1));
    30   printf (DL_NAME ":         dl02_bss2: %4u: %p: %f\n",   PAINT_VAR (dl02_bss2[0]));
    31   printf (DL_NAME ":         dl02_bss3: %4u: %p: %02x\n", PAINT_VAR (dl02_bss3[0]));
    32   printf (DL_NAME ":        dl02_data1: %4u: %p: %d\n",   PAINT_VAR (dl02_data1));
     28  printf (DL_NAME ": module: %s @ %p\n",
     29          dl_localise_file (__FILE__), rtems_main_o2);
     30  printf (DL_NAME ":         dl02_bss1: %4zu: %p: %d\n",   PAINT_VAR (dl02_bss1));
     31  printf (DL_NAME ":         dl02_bss2: %4zu: %p: %f\n",   PAINT_VAR (dl02_bss2[0]));
     32  printf (DL_NAME ":         dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0]));
     33  printf (DL_NAME ":        dl02_data1: %4zu: %p: %08x\n", PAINT_VAR (dl02_data1));
    3334  /* no %f in the rtems test printer */
    34   printf (DL_NAME ":        dl02_data2: %4u: %p: %f\n",   PAINT_VAR (dl02_data2));
     35  printf (DL_NAME ":        dl02_data2: %4zu: %p: %f\n",   PAINT_VAR (dl02_data2));
    3536
    3637  rtems_main_o3 ();
  • testsuites/libtests/dl09/dl-o3.c

    r194eb403 r6c9f017  
    2222int rtems_main_o3 ()
    2323{
    24   printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    25   printf (DL_NAME ":   dl04_unresolv_1: %4u: %p: %d\n",          PAINT_VAR (dl04_unresolv_1));
    26   printf (DL_NAME ":   dl04_unresolv_2: %4u: %p: %f\n",          PAINT_VAR (dl04_unresolv_2));
    27   printf (DL_NAME ":   dl04_unresolv_3: %4u: %p: %02x\n",        PAINT_VAR (dl04_unresolv_3));
    28   printf (DL_NAME ":   dl04_unresolv_4: %4u: %p: %p\n",          PAINT_VAR (dl04_unresolv_4));
    29   printf (DL_NAME ":   dl04_unresolv_5: %4u: %p: %d\n",          PAINT_VAR (dl04_unresolv_5));
    30   printf (DL_NAME ":   dl04_unresolv_6: %4u: %p: %s\n",          PAINT_VAR (dl04_unresolv_6));
    31   printf (DL_NAME ":   dl05_unresolv_1: %4u: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
    32   printf (DL_NAME ":   dl05_unresolv_2: %4u: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
    33   printf (DL_NAME ":   dl05_unresolv_3: %4u: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
    34   printf (DL_NAME ":   dl05_unresolv_4: %4u: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
    35   printf (DL_NAME ":   dl05_unresolv_5: %4u: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
     24  printf (DL_NAME ": module: %s : %p\n",
     25          dl_localise_file (__FILE__), rtems_main_o3);
     26  printf (DL_NAME ":   dl04_unresolv_1: %4zu: %p: %d\n",          PAINT_VAR (dl04_unresolv_1));
     27  printf (DL_NAME ":   dl04_unresolv_2: %4zu: %p: %f\n",          PAINT_VAR (dl04_unresolv_2));
     28  printf (DL_NAME ":   dl04_unresolv_3: %4zu: %p: %02x\n",        PAINT_VAR (dl04_unresolv_3));
     29  printf (DL_NAME ":   dl04_unresolv_4: %4zu: %p: %p\n",          PAINT_VAR (dl04_unresolv_4));
     30  printf (DL_NAME ":   dl04_unresolv_5: %4zu: %p: %d\n",          PAINT_VAR (dl04_unresolv_5));
     31  printf (DL_NAME ":   dl04_unresolv_6: %4zu: %p: %s\n",          PAINT_VAR (dl04_unresolv_6));
     32  printf (DL_NAME ":   dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
     33  printf (DL_NAME ":   dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
     34  printf (DL_NAME ":   dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
     35  printf (DL_NAME ":   dl05_unresolv_4: %4zu: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
     36  printf (DL_NAME ":   dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
    3637
    3738  rtems_main_o4 ();
  • testsuites/libtests/dl09/dl-o4.c

    r194eb403 r6c9f017  
    1515#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__);
    1616
    17 int         dl04_unresolv_1;
     17int         dl04_unresolv_1 = 12345;
    1818float       dl04_unresolv_2;
    19 char        dl04_unresolv_3;
    20 char*       dl04_unresolv_4;
     19char        dl04_unresolv_3 = 'z';
     20char*       dl04_unresolv_4 = "aBcDeF";
    2121const int   dl04_unresolv_5 = 4;
    2222const char* dl04_unresolv_6 = "dl-O4";
     
    2727int rtems_main_o4 (void)
    2828{
    29   printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    30   printf (DL_NAME ":   dl04_unresolv_1: %4u: %p: %d\n",   PAINT_VAR (dl04_unresolv_1));
    31   printf (DL_NAME ":   dl04_unresolv_2: %4u: %p: %f\n",   PAINT_VAR (dl04_unresolv_2));
    32   printf (DL_NAME ":   dl04_unresolv_3: %4u: %p: %02x\n", PAINT_VAR (dl04_unresolv_3));
    33   printf (DL_NAME ":   dl04_unresolv_4: %4u: %p: %p\n",   PAINT_VAR (dl04_unresolv_4));
    34   printf (DL_NAME ":   dl04_unresolv_5: %4u: %p: %d\n",   PAINT_VAR (dl04_unresolv_5));
    35   printf (DL_NAME ":   dl04_unresolv_6: %4u: %p: %s\n",   PAINT_VAR (dl04_unresolv_6));
     29  printf (DL_NAME ": module: %s @ %p\n",
     30          dl_localise_file (__FILE__), rtems_main_o4);
     31  printf (DL_NAME ":   dl04_unresolv_1: %4zu: %p: %d\n",   PAINT_VAR (dl04_unresolv_1));
     32  printf (DL_NAME ":   dl04_unresolv_2: %4zu: %p: %f\n",   PAINT_VAR (dl04_unresolv_2));
     33  printf (DL_NAME ":   dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3));
     34  printf (DL_NAME ":   dl04_unresolv_4: %4zu: %p: %s\n",   PAINT_VAR (dl04_unresolv_4));
     35  printf (DL_NAME ":   dl04_unresolv_5: %4zu: %p: %d\n",   PAINT_VAR (dl04_unresolv_5));
     36  printf (DL_NAME ":   dl04_unresolv_6: %4zu: %p: %s\n",   PAINT_VAR (dl04_unresolv_6));
    3637
    3738  rtems_main_o5 ();
  • testsuites/libtests/dl09/dl-o5.c

    r194eb403 r6c9f017  
    2727int rtems_main_o5 (void)
    2828{
    29   printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
    30   printf (DL_NAME ":   dl05_unresolv_1: %4u: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
    31   printf (DL_NAME ":   dl05_unresolv_2: %4u: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
    32   printf (DL_NAME ":   dl05_unresolv_3: %4u: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
    33   printf (DL_NAME ":   dl05_unresolv_4: %4u: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
    34   printf (DL_NAME ":   dl05_unresolv_5: %4u: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
     29  printf (DL_NAME ": module: %s @ %p\n",
     30          dl_localise_file (__FILE__), rtems_main_o5);
     31  printf (DL_NAME ":   dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1));
     32  printf (DL_NAME ":   dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2));
     33  printf (DL_NAME ":   dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3));
     34  printf (DL_NAME ":   dl05_unresolv_4: %4zu: %p: %" PRIu8  "\n", PAINT_VAR (dl05_unresolv_4));
     35  printf (DL_NAME ":   dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5));
    3536
    3637  return 0;
Note: See TracChangeset for help on using the changeset viewer.