Nice .progmem.data output from objdump

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When .progmem.data that was declared in C code with PROGMEM is dumped by avr-objdump , I get a nice hex-style output with bytes and characters.

But when I do something like the following in an asm file, objdump interprets it as code

.section .progmem.data
.global table
table:
    .byte  70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80

I've tried ".section .progmem.data,"a",@progbits" but that didn't make a difference. I looked at the .lst file for a compiled C file and it seems equivalent to the asm code.

I ask because I am grepping the output of objdump for stuff like "mul" and keep getting false hits from the data bytes interpreted as code.

-Brad

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Build the .s file and see what the C compiler passed to the assembler then just copy that syntax.

EDIT: in fact doing this in .c:

const uint8_t PROGMEM freddle[] = { 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 };

led to this in the .s:

.global	freddle
	.section	.progmem.data,"a",@progbits
	.type	freddle, @object
	.size	freddle, 11
freddle:
	.byte	70
	.byte	71
	.byte	72
	.byte	73
	.byte	74
	.byte	75
	.byte	76
	.byte	77
	.byte	78
	.byte	79
	.byte	80

which then led to this in the avr-objdump:

00000054 :
      54:	46 47 48 49 4a 4b 4c 4d 4e 4f 50                    FGHIJKLMNOP

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah thanks. I thought I had done just that when I looked at the .lst file that is generated with "-Wa,-adhlns" in the standard avr makefile templates. I guess those avr-as listing files aren't exactly what I thought they were.

-Brad