diff options
author | Doug Kwan <dougkwan@google.com> | 2012-05-08 17:18:16 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2012-05-08 17:18:16 +0000 |
commit | 812beecb47cb77ed4984659840ac74e1c51fc908 (patch) | |
tree | 6a55e6f4f5ba45916d0fcdd05773237443911440 | |
parent | 45a855816faeb72013072d9eb7ee152ed856756b (diff) | |
download | binutils-redhat-812beecb47cb77ed4984659840ac74e1c51fc908.tar.gz |
2012-05-08 Ben Cheng <bccheng@google.com>
* bfd/elf.c: Preserve the original p_align and p_flags if they are
valid.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f695aef0d4..4c49cf9b59 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2012-05-08 Ben Cheng <bccheng@google.com> + + * bfd/elf.c: Preserve the original p_align and p_flags if they are + valid. + 2012-05-07 Alan Modra <amodra@gmail.com> * elf64-ia64-vms.c (elf64_ia64_relocate_section): Update @@ -4931,8 +4931,14 @@ assign_file_positions_for_non_load_sections (bfd *abfd, else abort (); p->p_memsz = p->p_filesz; - p->p_align = 1; - p->p_flags = (lp->p_flags & ~PF_W); + /* Preserve the alignment and flags if they are valid. The gold + linker generates RW/4 for the PT_GNU_RELRO section. It is better + for objcopy/strip to honor these attributes otherwise gdb will + choke when using separate debug files. */ + if (!m->p_align_valid) + p->p_align = 1; + if (!m->p_flags_valid) + p->p_flags = (lp->p_flags & ~PF_W); } else { |