aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-macho.c
diff options
context:
space:
mode:
authorIain Sandoe <iain@codesourcery.com>2012-02-20 19:44:40 +0000
committerIain Sandoe <iain@codesourcery.com>2012-02-20 19:44:40 +0000
commita5759139f8d7072af4def4d46fb1bc39cdf68ce7 (patch)
tree72707071f27c9020389512478bd0b149ca1e923d /gas/config/obj-macho.c
parent3a9b40b6dd3f889d24aea0369456d560337266f0 (diff)
downloadgdb-a5759139f8d7072af4def4d46fb1bc39cdf68ce7.zip
gdb-a5759139f8d7072af4def4d46fb1bc39cdf68ce7.tar.gz
gdb-a5759139f8d7072af4def4d46fb1bc39cdf68ce7.tar.bz2
gas:
* config/obj-macho.c (obj_mach_o_make_or_get_sect): In the absence of canonical information, try to determine CODE and DEBUG section flags from the mach-o section data.
Diffstat (limited to 'gas/config/obj-macho.c')
-rw-r--r--gas/config/obj-macho.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c
index 2a2e47d..b0ef741 100644
--- a/gas/config/obj-macho.c
+++ b/gas/config/obj-macho.c
@@ -240,6 +240,18 @@ obj_mach_o_make_or_get_sect (char * segname, char * sectname,
if (oldflags == SEC_NO_FLAGS)
{
+ /* In the absence of canonical information, try to determine CODE and
+ DEBUG section flags from the mach-o section data. */
+ if (flags == SEC_NO_FLAGS
+ && (specified_mask & SECT_ATTR_SPECIFIED)
+ && (secattr & BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS))
+ flags |= SEC_CODE;
+
+ if (flags == SEC_NO_FLAGS
+ && (specified_mask & SECT_ATTR_SPECIFIED)
+ && (secattr & BFD_MACH_O_S_ATTR_DEBUG))
+ flags |= SEC_DEBUGGING;
+
/* New, so just use the defaults or what's specified. */
if (! bfd_set_section_flags (stdoutput, sec, flags))
as_warn (_("failed to set flags for \"%s\": %s"),