diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-11-18 06:02:15 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-11-18 06:02:15 +0000 |
commit | cfc74b78b13cd839c49f1f2b0b7033f32c5c1109 (patch) | |
tree | a9a6af9e1ec8931ae7eea70f2687120e4312c06c /lib/Target/TargetLoweringObjectFile.cpp | |
parent | 35da61aba143cc6d35224ed008b30e07bc6486c3 (diff) |
Stop producing .data.rel sections.
If a section is rw, it is irrelevant if the dynamic linker will write to
it or not.
It looks like llvm implemented this because gcc was doing it. It looks
like gcc implemented this in the hope that it would put all the
relocated items close together and speed up the dynamic linker.
There are two problem with this:
* It doesn't work. Both bfd and gold will map .data.rel to .data and
concatenate the input sections in the order they are seen.
* If we want a feature like that, it can be implemented directly in the
linker since it knowns where the dynamic relocations are.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | lib/Target/TargetLoweringObjectFile.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp index 5ccdae42024..a0b0d8f2404 100644 --- a/lib/Target/TargetLoweringObjectFile.cpp +++ b/lib/Target/TargetLoweringObjectFile.cpp @@ -227,11 +227,11 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV, // globals together onto fewer pages, improving the locality of the dynamic // linker. if (ReloModel == Reloc::Static) - return SectionKind::getDataNoRel(); + return SectionKind::getData(); if (C->needsRelocation()) - return SectionKind::getDataRel(); - return SectionKind::getDataNoRel(); + return SectionKind::getData(); + return SectionKind::getData(); } /// This method computes the appropriate section to emit the specified global |