diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-09-12 00:32:32 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-09-12 00:32:32 +0000 |
commit | 8c42d0108994a1de29ba4ddafcb811670e67f71b (patch) | |
tree | 914fb4feed2d28328637b04e3f630f72e4349171 /bfd/peigen.c | |
parent | cb43721da5d2e451a068fc3397b89ec1f47ce2bc (diff) | |
download | gdb-8c42d0108994a1de29ba4ddafcb811670e67f71b.zip gdb-8c42d0108994a1de29ba4ddafcb811670e67f71b.tar.gz gdb-8c42d0108994a1de29ba4ddafcb811670e67f71b.tar.bz2 |
1999-09-11 Donn Terry <donn@interix.com>
* peigen.c (_bfd_pei_swap_scnhdr_out): Remove code which sets
section flags based on the section name.
Diffstat (limited to 'bfd/peigen.c')
-rw-r--r-- | bfd/peigen.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/bfd/peigen.c b/bfd/peigen.c index a79b857..3593ba9 100644 --- a/bfd/peigen.c +++ b/bfd/peigen.c @@ -909,52 +909,8 @@ _bfd_pei_swap_scnhdr_out (abfd, in, out) /* FIXME: even worse, I don't see how to get the original alignment field*/ /* back... */ - /* FIXME: Basing this on section names is bogus. Also, this should - be in sec_to_styp_flags. */ - { int flags = scnhdr_int->s_flags; - if (strcmp (scnhdr_int->s_name, ".data") == 0 || - strcmp (scnhdr_int->s_name, ".CRT") == 0 || - strcmp (scnhdr_int->s_name, ".bss") == 0) - flags |= IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE; - else if (strcmp (scnhdr_int->s_name, ".text") == 0) - flags |= IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_EXECUTE; - else if (strcmp (scnhdr_int->s_name, ".reloc") == 0) - flags = (SEC_DATA | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_DISCARDABLE - | IMAGE_SCN_MEM_SHARED); - else if (strcmp (scnhdr_int->s_name, ".idata") == 0) - flags = IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE | SEC_DATA; - else if (strcmp (scnhdr_int->s_name, ".rdata") == 0 - || strcmp (scnhdr_int->s_name, ".edata") == 0) - flags = IMAGE_SCN_MEM_READ | SEC_DATA; - else if (strcmp (scnhdr_int->s_name, ".pdata") == 0) - flags = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_ALIGN_4BYTES | - IMAGE_SCN_MEM_READ ; - /* Remember this field is a max of 8 chars, so the null is _not_ there - for an 8 character name like ".reldata". (yep. Stupid bug) */ - else if (strncmp (scnhdr_int->s_name, ".reldata", 8) == 0) - flags = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_ALIGN_8BYTES | - IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE ; - else if (strcmp (scnhdr_int->s_name, ".ydata") == 0) - flags = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_ALIGN_8BYTES | - IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE ; - else if (strncmp (scnhdr_int->s_name, ".drectve", 8) == 0) - flags = IMAGE_SCN_LNK_INFO | IMAGE_SCN_LNK_REMOVE ; - else if (strncmp (scnhdr_int->s_name, ".stab", 5) == 0) - flags |= (IMAGE_SCN_LNK_INFO | IMAGE_SCN_MEM_DISCARDABLE - | IMAGE_SCN_MEM_SHARED | IMAGE_SCN_MEM_READ); - else if (strcmp (scnhdr_int->s_name, ".rsrc") == 0) - flags |= IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_SHARED; - else - { - flags |= IMAGE_SCN_MEM_READ; - if (! (flags & SEC_READONLY)) - flags |= IMAGE_SCN_MEM_WRITE; - if (flags & SEC_SHARED) - flags |= IMAGE_SCN_MEM_SHARED; - } - bfd_h_put_32(abfd, flags, (bfd_byte *) scnhdr_ext->s_flags); } |