splinkersets01: Test linker sets in library

Make sure that the linker sets work if placed in a library (this is how
they are used in RTEMS).
This commit is contained in:
Sebastian Huber
2021-06-10 08:41:05 +02:00
parent 93afcff7b5
commit 2769554243
7 changed files with 66 additions and 7 deletions

View File

@@ -12,6 +12,8 @@ ldflags:
- -Wl,--wrap=printf
- -Wl,--wrap=puts
links:
- role: build-dependency
uid: libsplinkersets01
- role: build-dependency
uid: sp01
- role: build-dependency

View File

@@ -0,0 +1,19 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
build-type: library
cflags: []
copyrights:
- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
cppflags: []
cxxflags: []
enabled-by: true
includes: []
install: []
install-path: null
links: []
source:
- testsuites/sptests/splinkersets01/content.c
- testsuites/sptests/splinkersets01/item-a.c
- testsuites/sptests/splinkersets01/item-ca.c
- testsuites/sptests/splinkersets01/sets.c
target: splinkersets01
type: build

View File

@@ -12,8 +12,6 @@ ldflags: []
links: []
source:
- testsuites/sptests/splinkersets01/init.c
- testsuites/sptests/splinkersets01/items.c
- testsuites/sptests/splinkersets01/sets.c
stlib: []
target: testsuites/sptests/splinkersets01.exe
type: build

View File

@@ -1943,7 +1943,9 @@ endif
if TEST_splinkersets01
sp_libs += libsplinkersets01.a
libsplinkersets01_a_SOURCES = splinkersets01/sets.c \
splinkersets01/items.c
splinkersets01/content.c \
splinkersets01/item-a.c \
splinkersets01/item-ca.c
endif
noinst_PROGRAMS = $(sp_tests)

View File

@@ -18,10 +18,6 @@
#include "splinkersets01.h"
RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw, const int *, a1, 1) = &a[1];
RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro, const int *, ca2, OC) = &ca[2];
int content_rw_1;
char content_rw_2;
char content_rw_3;

View File

@@ -0,0 +1,21 @@
/*
* Copyright (c) 2015, 2016 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "splinkersets01.h"
RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw, const int *, a1, 1) = &a[1];

View File

@@ -0,0 +1,21 @@
/*
* Copyright (c) 2015, 2016 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "splinkersets01.h"
RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro, const int *, ca2, OC) = &ca[2];