From a5759139f8d7072af4def4d46fb1bc39cdf68ce7 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Mon, 20 Feb 2012 19:44:40 +0000 Subject: [PATCH] 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. --- gas/ChangeLog | 6 ++++++ gas/config/obj-macho.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index dbafd58..d6d30c1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2012-02-20 Iain Sandoe + + * 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. + 2012-02-20 Nick Clifton * cgen.c (gas_cgen_parse_operand): Do not set BSF_RELC flag on 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"), -- 2.7.4