aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-10-19 06:02:46 +0000
committerMark Mitchell <mark@codesourcery.com>2004-10-19 06:02:46 +0000
commit6df4d94c68f19ff89a25fdbc3d9df60cadf1876f (patch)
treecfdc1bfca0bff70a19fe4256ee8737ab4b5deaee /bfd/elflink.c
parentcad5e2c2ac6b2dc861b8ffaf3d4d3b755c5ab83d (diff)
downloadgdb-6df4d94c68f19ff89a25fdbc3d9df60cadf1876f.zip
gdb-6df4d94c68f19ff89a25fdbc3d9df60cadf1876f.tar.gz
gdb-6df4d94c68f19ff89a25fdbc3d9df60cadf1876f.tar.bz2
* elfarm-nabi.c (ELF_DYNAMIC_SEC_FLAGS): Add comment.
* elflink.c (_bfd_elf_create_dynamic_sections): For a loaded PLT, set SEC_ALLOC and SEC_LOAD.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 68435bb..6e3f91f 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -252,9 +252,13 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
flags = bed->dynamic_sec_flags;
pltflags = flags;
- pltflags |= SEC_CODE;
if (bed->plt_not_loaded)
+ /* We do not clear SEC_ALLOC here because we still want the OS to
+ allocate space for the section; it's just that there's nothing
+ to read in from the object file. */
pltflags &= ~ (SEC_CODE | SEC_LOAD | SEC_HAS_CONTENTS);
+ else
+ pltflags |= SEC_ALLOC | SEC_CODE | SEC_LOAD;
if (bed->plt_readonly)
pltflags |= SEC_READONLY;