Skip to content

Commit 8bc4539

Browse files
Andy Rossnashif
authored andcommitted
soc/intel_adsp: Correct linker syntax for ancient binutils
Older binutils, like the (nine-year-old!) 2.23 version that powers many Cadence XCC toolchains, happen not to support the "~" operator to perform bitwise negation. And they generate an absolutely hilarious series of inscrutable error messages when they try to tell you this fairly simple fact. Just fold it into the constant. Signed-off-by: Andy Ross <[email protected]>
1 parent 0552d32 commit 8bc4539

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

soc/xtensa/intel_adsp/cavs_v15/linker.ld

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ PROVIDE(_MemErrorHandler = 0x00000000);
4242
* the output tooling ignores it, but it will cause the linker to emit
4343
* 512MB of unused data into the output file!)
4444
*
45+
* (Note clumsy syntax because XCC doesn't understand the "~" operator)
46+
*
4547
*/
4648
#define SEGSTART_CACHED (ALIGN(64) | 0x20000000)
47-
#define SEGSTART_UNCACHED (ALIGN(64) & ~0x20000000)
49+
#define SEGSTART_UNCACHED (ALIGN(64) & 0xdfffffff) /* == ~0x20000000 */
4850

4951
MEMORY
5052
{

soc/xtensa/intel_adsp/cavs_v18/linker.ld

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ PROVIDE(_MemErrorHandler = 0x00000000);
4242
* the output tooling ignores it, but it will cause the linker to emit
4343
* 512MB of unused data into the output file!)
4444
*
45+
* (Note clumsy syntax because XCC doesn't understand the "~" operator)
46+
*
4547
*/
4648
#define SEGSTART_CACHED (ALIGN(64) | 0x20000000)
47-
#define SEGSTART_UNCACHED (ALIGN(64) & ~0x20000000)
49+
#define SEGSTART_UNCACHED (ALIGN(64) & 0xdfffffff) /* == ~0x20000000 */
4850

4951
MEMORY
5052
{

soc/xtensa/intel_adsp/cavs_v25/linker.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ PROVIDE(_MemErrorHandler = 0x00000000);
4242
* the output tooling ignores it, but it will cause the linker to emit
4343
* 512MB of unused data into the output file!)
4444
*
45+
* (Note clumsy syntax because XCC doesn't understand the "~" operator)
4546
*/
4647
#ifdef CONFIG_KERNEL_COHERENCE
4748
#define SEGSTART_CACHED (ALIGN(64) | 0x20000000)
48-
#define SEGSTART_UNCACHED (ALIGN(64) & ~0x20000000)
49+
#define SEGSTART_UNCACHED (ALIGN(64) & 0xdfffffff) /* == ~0x20000000 */
4950
#else
5051
#define SEGSTART_CACHED /**/
5152
#define SEGSTART_UNCACHED /**/

0 commit comments

Comments
 (0)