Testcase: $ cat test.ll @.str.47 = private unnamed_addr constant [10 x i8] c"anonymous\00", align 1 define i32 @patatino(i8* nonnull %myptr) { %blah = call i32 @strcmp(i8* nonnull %myptr, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.47, i64 0, i64 0)) ret i32 %blah } declare i32 @strcmp(i8* nocapture, i8* nocapture) local_unnamed_addr $ ./llvm-extract patatino.ll -func=patatino -S ; ModuleID = 'patatino.ll' source_filename = "patatino.ll" @.str.47 = external hidden unnamed_addr constant [10 x i8], align 1 define i32 @patatino(i8* nonnull %myptr) { %blah = call i32 @strcmp(i8* nonnull %myptr, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.47, i64 0, i64 0)) ret i32 %blah } declare i32 @strcmp(i8* nocapture, i8* nocapture) local_unnamed_addr In the output, @.str.47 should be extracted (found out while reducing an optimization bug and moving a given function to its own object file, and observing a link failure because the private string was internalized and the linker wasn't able to resolve the symbol).