]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/wayland/0001-Support-architectures-with-non-empty-__USER_LABEL_PR.patch
Merge branch 'next'
[coffee/buildroot.git] / package / wayland / 0001-Support-architectures-with-non-empty-__USER_LABEL_PR.patch
1 From 0a337328411d5b3f37b169a83b6fee3f1726130f Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Thu, 26 May 2016 15:57:33 +0200
4 Subject: [PATCH] Support architectures with non-empty __USER_LABEL_PREFIX__
5
6 On some architectures (like Blackfin), a C symbol does not directly
7 match with assembly symbols. The C symbol references are in fact all
8 prefixed by a so-called "user label prefix". So when a symbol defined
9 in an assembly file needs to be referenced from C, this symbol should
10 be prefixed by the "user label prefix".
11
12 This commit updates dtddata.S to take into account
13 __USER_LABEL_PREFIX__ when it exists.
14
15 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
16 ---
17  src/dtddata.S | 19 +++++++++++++------
18  1 file changed, 13 insertions(+), 6 deletions(-)
19
20 diff --git a/src/dtddata.S b/src/dtddata.S
21 index ce51133..ad2a4db 100644
22 --- a/src/dtddata.S
23 +++ b/src/dtddata.S
24 @@ -30,17 +30,24 @@
25  
26  /* from: http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967#comment-348129 */
27  
28 +#ifdef __USER_LABEL_PREFIX__
29 +#define CONCAT1(a, b) CONCAT2(a, b)
30 +#define CONCAT2(a, b) a ## b
31 +#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
32 +#else
33 +#endif
34 +
35  .macro binfile name file
36         .p2align 2
37 -       .globl \name\()_begin
38 -\name\()_begin:
39 +       .globl SYM(\name\()_begin)
40 +SYM(\name\()_begin):
41         .incbin "\file"
42 -\name\()_end:
43 +SYM(\name\()_end):
44         .byte 0
45         .p2align 2
46 -       .globl \name\()_len
47 -\name\()_len:
48 -       .int (\name\()_end - \name\()_begin)
49 +       .globl SYM(\name\()_len)
50 +SYM(\name\()_len):
51 +       .int (SYM(\name\()_end) - SYM(\name\()_begin))
52  .endm
53  
54  .section .rodata
55 -- 
56 2.7.4
57