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

Side by Side Diff: src/IceELFObjectWriter.cpp

Issue 955003002: Subzero: Clean up function header emission. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix the tests that were broken as a result Created 5 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « src/IceCfg.cpp ('k') | tests_lit/assembler/x86/immediate_encodings.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===// 1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file defines the writer for ELF relocatable object files. 10 // This file defines the writer for ELF relocatable object files.
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 break; 363 break;
364 } 364 }
365 365
366 const uint8_t SymbolType = STT_OBJECT; 366 const uint8_t SymbolType = STT_OBJECT;
367 for (VariableDeclaration *Var : Vars) { 367 for (VariableDeclaration *Var : Vars) {
368 // If the variable declaration does not have an initializer, its symtab 368 // If the variable declaration does not have an initializer, its symtab
369 // entry will be created separately. 369 // entry will be created separately.
370 if (!Var->hasInitializer()) 370 if (!Var->hasInitializer())
371 continue; 371 continue;
372 Elf64_Xword Align = Var->getAlignment(); 372 Elf64_Xword Align = Var->getAlignment();
373 const Elf64_Xword MinAlign = 1;
374 Align = std::max(Align, MinAlign);
373 Section->padToAlignment(Str, Align); 375 Section->padToAlignment(Str, Align);
374 SizeT SymbolSize = Var->getNumBytes(); 376 SizeT SymbolSize = Var->getNumBytes();
375 bool IsExternal = Var->isExternal() || Ctx.getFlags().getDisableInternal(); 377 bool IsExternal = Var->isExternal() || Ctx.getFlags().getDisableInternal();
376 const uint8_t SymbolBinding = IsExternal ? STB_GLOBAL : STB_LOCAL; 378 const uint8_t SymbolBinding = IsExternal ? STB_GLOBAL : STB_LOCAL;
377 IceString MangledName = Var->mangleName(&Ctx); 379 IceString MangledName = Var->mangleName(&Ctx);
378 SymTab->createDefinedSym(MangledName, SymbolType, SymbolBinding, Section, 380 SymTab->createDefinedSym(MangledName, SymbolType, SymbolBinding, Section,
379 Section->getCurrentSize(), SymbolSize); 381 Section->getCurrentSize(), SymbolSize);
380 StrTab->add(MangledName); 382 StrTab->add(MangledName);
381 if (!Var->hasNonzeroInitializer()) { 383 if (!Var->hasNonzeroInitializer()) {
382 assert(ST == BSS || ST == ROData); 384 assert(ST == BSS || ST == ROData);
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 if (IsELF64) { 611 if (IsELF64) {
610 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), 612 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(),
611 AllSections.size()); 613 AllSections.size());
612 } else { 614 } else {
613 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), 615 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(),
614 AllSections.size()); 616 AllSections.size());
615 } 617 }
616 } 618 }
617 619
618 } // end of namespace Ice 620 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCfg.cpp ('k') | tests_lit/assembler/x86/immediate_encodings.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698