xref: /illumos-gate/usr/src/test/elf-tests/tests/groups/no-relobj-group-merge/sections.s (revision fc910014e8a32a65612105835a10995f2c13d942)
1/*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source.  A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12/* Copyright 2022, Richard Lowe. */
13
14/*
15 * We want to verify that if two sections which otherwise will be merged during
16 * the link-edit are members of groups that they are not merged
17 * but that if they are of the same group they will be discarded.
18 */
19
20	/*
21	 * .test_data_conflict
22	 * A member of group1, one copy will be kept
23	 */
24	.section	.test_data_conflict,"aG",@progbits,group1,comdat
25	.string "2: test_data_conflict (group 1)"
26
27	/*
28	 * .test_data_conflict
29	 * A member of group2.  One copy will be kept, and that copy will _not_
30	 * be merged into a single .test_data_conflict section
31	 */
32	.section	.test_data_conflict,"aG",@progbits,group2,comdat
33	.string "3: test_data_conflict (group 2)"
34
35	/*
36	 * .test_data_conflict
37	 * Not a member of any group.  Both copies will be kept and will be
38	 * merged, but will _not_ be merged into a section that is part of
39	 * a group.
40	 */
41	.section	.test_data_conflict,"a",@progbits
42	.string "4: test_data_conflict (two copies not in group)"
43