Bug 24554 - [objcopy] --rename-section marking section NOBITS
Summary: [objcopy] --rename-section marking section NOBITS
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-14 20:21 UTC by Nick Desaulniers
Modified: 2019-05-15 18:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.