Bug 24554

Summary: [objcopy] --rename-section marking section NOBITS
Product: binutils Reporter: Nick Desaulniers <ndesaulniers>
Component: binutilsAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: normal CC: amodra
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Nick Desaulniers 2019-05-14 20:21:40 UTC
via this thread from LKML: https://lkml.org/lkml/2019/5/14/668

it seems that use of the flag `--rename-section .text=.rodata,alloc,readonly` marks the resulting section as type NOBITS (PROGBITS was expected).

Is there an additional flag that we should be using, or is this considered a bug?
Comment 1 Alan Modra 2019-05-15 07:37:23 UTC
Yes, you should be using other flags.  Hint: use objdump to look at flags for .rodata on an object file that hasn't been munged by objcopy.
Comment 2 Nick Desaulniers 2019-05-15 18:16:41 UTC
For future travelers, it seems that the "load" flag was required:

`--rename-section .text=.rodata,alloc,readonly,load`

Thanks for the tip.