mirror of
https://git.rtems.org/rtems-docs/
synced 2025-10-18 22:13:01 +08:00
c-user: Fix linker set code blocks
This commit is contained in:
@@ -92,11 +92,11 @@ section descriptions.
|
|||||||
|
|
||||||
/* To be placed in a read-only memory region */
|
/* To be placed in a read-only memory region */
|
||||||
.rtemsroset : {
|
.rtemsroset : {
|
||||||
KEEP (*(SORT(.rtemsroset.*)))
|
KEEP (*(SORT(.rtemsroset.*)))
|
||||||
}
|
}
|
||||||
/* To be placed in a read-write memory region */
|
/* To be placed in a read-write memory region */
|
||||||
.rtemsrwset : {
|
.rtemsrwset : {
|
||||||
KEEP (*(SORT(.rtemsrwset.*)))
|
KEEP (*(SORT(.rtemsrwset.*)))
|
||||||
}
|
}
|
||||||
|
|
||||||
The ``KEEP()`` ensures that a garbage collection by the linker will not discard
|
The ``KEEP()`` ensures that a garbage collection by the linker will not discard
|
||||||
@@ -436,7 +436,7 @@ NOTES:
|
|||||||
#include <rtems/linkersets.h>
|
#include <rtems/linkersets.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int foo;
|
int foo;
|
||||||
} xyz_item;
|
} xyz_item;
|
||||||
|
|
||||||
/* The XYZ-order defines */
|
/* The XYZ-order defines */
|
||||||
@@ -445,10 +445,10 @@ NOTES:
|
|||||||
|
|
||||||
/* Defines an ordered XYZ-item */
|
/* Defines an ordered XYZ-item */
|
||||||
#define XYZ_ITEM( item, order ) \
|
#define XYZ_ITEM( item, order ) \
|
||||||
enum { xyz_##item = order - order }; \
|
enum { xyz_##item = order }; \
|
||||||
RTEMS_LINKER_ROSET_ITEM_ORDERED( \
|
RTEMS_LINKER_ROSET_ITEM_ORDERED( \
|
||||||
xyz, const xyz_item *, item, order \
|
xyz, const xyz_item *, item, order \
|
||||||
) = { &item }
|
) = { &item }
|
||||||
|
|
||||||
/* Example item */
|
/* Example item */
|
||||||
static const xyz_item some_item = { 123 };
|
static const xyz_item some_item = { 123 };
|
||||||
@@ -636,7 +636,7 @@ NOTES:
|
|||||||
#include <rtems/linkersets.h>
|
#include <rtems/linkersets.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int foo;
|
int foo;
|
||||||
} xyz_item;
|
} xyz_item;
|
||||||
|
|
||||||
/* The XYZ-order defines */
|
/* The XYZ-order defines */
|
||||||
@@ -645,10 +645,11 @@ NOTES:
|
|||||||
|
|
||||||
/* Defines an ordered XYZ-item */
|
/* Defines an ordered XYZ-item */
|
||||||
#define XYZ_ITEM( item, order ) \
|
#define XYZ_ITEM( item, order ) \
|
||||||
enum { xyz_##item = order - order }; \
|
enum { xyz_##item = order }; \
|
||||||
RTEMS_LINKER_RWSET_ITEM_ORDERED( \
|
RTEMS_LINKER_RWSET_ITEM_ORDERED( \
|
||||||
xyz, const xyz_item *, item, order \
|
xyz, const xyz_item *, item, order \
|
||||||
) = { &item }
|
) = { &item }
|
||||||
|
|
||||||
/* Example item */
|
/* Example item */
|
||||||
static const xyz_item some_item = { 123 };
|
static const xyz_item some_item = { 123 };
|
||||||
XYZ_ITEM( some_item, XYZ_ORDER_FIRST );
|
XYZ_ITEM( some_item, XYZ_ORDER_FIRST );
|
||||||
|
Reference in New Issue
Block a user