Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid assembly generated with DWARF2 and Obj-C GC #1385

Closed
llvmbot opened this issue Nov 20, 2006 · 6 comments
Closed

Invalid assembly generated with DWARF2 and Obj-C GC #1385

llvmbot opened this issue Nov 20, 2006 · 6 comments
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm-tools All llvm tools that do not have corresponding tag

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 20, 2006

Bugzilla Link 1013
Resolution FIXED
Resolved on Nov 07, 2018 00:17
Version trunk
OS MacOS X
Reporter LLVM Bugzilla Contributor

Extended Description

To reproduce:

-- objc_instance.m --
namespace {
class JSValue {
~JSValue();
};

JSValue::~JSValue()
{
}
}

$ llvm-gcc -save-temps -fobjc-gc -gdwarf-2 -c objc_instance.m
objc_instance.s:168:Rest of line ignored. 1st junk character valued 1 ().
$ head -n 168 objc_instance.s | tail -n 1 | xxd
0000000: 092e 6c6f 6e67 095f 014c 5f4f 424a 435f ..long..L_OBJC
0000010: 494d 4147 455f 494e 464f 0a IMAGE_INFO.
$

It appears that 0x01 has snuck into the symbol name between the _ and L in _L_OBJC_IMAGE_INFO.

@lattner
Copy link
Collaborator

lattner commented Nov 20, 2006

Jim, please take a look at this. This is most likely due to not using the Mangler interface when generating
references to globals.

-Chris

@llvmbot
Copy link
Collaborator Author

llvmbot commented Nov 20, 2006

Mark would you attach your objc_instance.s.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Nov 20, 2006

objc_instance.s

@llvmbot
Copy link
Collaborator Author

llvmbot commented Nov 20, 2006

Index: lib/CodeGen/AsmPrinter.cpp

====
RCS file: /var/cvs/llvm/llvm/lib/CodeGen/AsmPrinter.cpp,v
retrieving revision 1.116
diff -u -1 -0 -d -r1.116 AsmPrinter.cpp
--- lib/CodeGen/AsmPrinter.cpp 1 Nov 2006 09:23:08 -0000
1.116
+++ lib/CodeGen/AsmPrinter.cpp 20 Nov 2006 20:28:17 -0000
@@ -327,23 +327,31 @@
// Emit the function pointer.
EmitGlobalConstant(CS->getOperand(1));
}
}

/// getGlobalLinkName - Returns the asm/link name of of the specified
/// global variable. Should be overridden by each target asm printer to
/// generate the appropriate value.
const std::string AsmPrinter::getGlobalLinkName(const GlobalVariable *GV) const{
std::string LinkName;

  • // Default action is to use a global symbol.
  • LinkName = TAI->getGlobalPrefix();
  • LinkName += GV->getName();
  • if (isa(GV)) {
  • LinkName += TAI->getFunctionAddrPrefix();
  • LinkName += Mang->getValueName(GV);
  • LinkName += TAI->getFunctionAddrSuffix();
  • } else {
  • LinkName += TAI->getGlobalVarAddrPrefix();
  • LinkName += Mang->getValueName(GV);
  • LinkName += TAI->getGlobalVarAddrSuffix();
  • }
  • return LinkName;
    }

// EmitAlignment - Emit an alignment directive to the specified power of two.
void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV) const {
if (GV && GV->getAlignment())
NumBits = Log2_32(GV->getAlignment());
if (NumBits == 0) return; // No need to emit alignment.
if (TAI->getAlignmentIsInBytes()) NumBits = 1 << NumBits;
O << TAI->getAlignDirective() << NumBits << "\n";

@llvmbot
Copy link
Collaborator Author

llvmbot commented Nov 20, 2006

Thanks for the quick fix Jim.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#1504

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
clementval pushed a commit to clementval/llvm-project that referenced this issue Jan 17, 2022
[flang] Add lowering of EXIT intrinsic
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm-tools All llvm tools that do not have corresponding tag
Projects
None yet
Development

No branches or pull requests

2 participants