Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: binutils/gas/config/tc-i386.c

Issue 6001005: [binutils] Force assembler to align code section size (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git@master
Patch Set: ready for code review Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: binutils/gas/config/tc-i386.c
diff --git a/binutils/gas/config/tc-i386.c b/binutils/gas/config/tc-i386.c
index 6cc6b72394015c8c26e567a5dc119dc865a17320..2140582bd02d21623fe0a64ec152c4da86fd9407 100644
--- a/binutils/gas/config/tc-i386.c
+++ b/binutils/gas/config/tc-i386.c
@@ -8716,6 +8716,25 @@ md_undefined_symbol (name)
/* Round up a section size to the appropriate boundary. */
+#ifdef TC_NACL_C
+valueT
+md_section_align (segment, size)
+ segT segment;
+ valueT size;
+{
+ if (bfd_get_section_flags (stdoutput, segment) & SEC_CODE)
+ {
+ /* For NaCl, force the code section size to be aligned. This implies
+ padding with NOPs that is required for validation. */
+ int align;
+
+ align = bfd_get_section_alignment (stdoutput, segment);
+ size = ((size + (1 << align) - 1) & ((valueT) -1 << align));
+ }
+
+ return size;
+}
+#else
valueT
md_section_align (segment, size)
segT segment ATTRIBUTE_UNUSED;
@@ -8738,6 +8757,7 @@ md_section_align (segment, size)
return size;
}
+#endif
/* On the i386, PC-relative offsets are relative to the start of the
next instruction. That is, the address of the offset, plus its
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698