what do you mean by "code section"
I don't know how much you're aware of these things... so if something is unclear, just ask.
They call it by two different names; text section and code section. This is where your "assembled" code gets stored in the executable file.
When this section gets loaded into memory, we call that area text/code segment.
All of your instructions are there. (only your code tho)
The CPU will eventually jump to that location to run your program. (The address is virtual... but you don't need to worry about that)
String literals do not differ from integer literals. In this code
int foo = 12;
12 is an integer literal. If you look at the assembly code, you'll see that depending on where you put this piece of code your compiler will decide to put this 12 in a register or the data section. No matter what, that 12 is a part of the code as an operand. In assembly it should look like this:
mov DWORD PTR [rbp-4], 12 ; moves 12 to the stack
OR
foo:
.long 12 ; long is a directive that stores 12 in the current section
; *foo* will be its address
String literals are the same:
mov DWORD PTR [rsp+16], 1145258561 ; moves "ABCD" to the stack
1145258561 is a representation of "ABCD". It's hard-coded in the code section. That's what I mean by "It gets stored in the code section".
The thing is, you can address different locations of your code section as well. That's what happens to a large string literal. Your compiler will put it at the bottom of the code section and label it. That label will get replaced by the address of your string literal in the code section after the assembling phase.